RealtimeController:subscribe#58
Conversation
Co-Authored-By: Adrien Maret <amaret93@gmail.com>
scottinet
left a comment
There was a problem hiding this comment.
A few minor issues here and there, nothing important.
But something bothers me: how are realtime subscriptions handled whenever the SDK reconnects after a connection loss?
| (response) -> { | ||
| String channel = ((ConcurrentHashMap<String, Object>) response.result).get("channel").toString(); | ||
| Subscription subscription = new Subscription( | ||
| options == null ? new SubscribeOptions().isSubscribeToSelf() : options.isSubscribeToSelf(), |
There was a problem hiding this comment.
Since the SubscribeOptions object is mutable, you should probably duplicate it at the beginning of this function and, from there, only use the copy, to prevent potential race conditions.
I didn't know the SDK should re subscribe after a connection loss. I took example on the C# SDK and it simply close all the subscriptions when it looses connection. |
Co-Authored-By: Sébastien Cottinet <scottinet@protonmail.com>
…uzzleio/sdk-java into KZL-1352-realtime-controller-subscribe
What does this PR do ?
Add a
RealtimeControllerwith thesubscribemethod.How should this be manually tested?
./gradlew test