-
Notifications
You must be signed in to change notification settings - Fork 219
Resubscribe channels only when reconnecting #548
base: develop
Are you sure you want to change the base?
Resubscribe channels only when reconnecting #548
Conversation
|
||
connectionSuccessEmitters.forEach(emitter -> emitter.onNext(new Object())); | ||
}); | ||
.doOnComplete(() -> connectionSuccessEmitters.forEach(emitter -> emitter.onNext(new Object()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check that this still works for exchanges such as Binance where channel subscriptions are made on connection?
() -> connect().subscribe( | ||
() -> { | ||
LOG.warn("Resubscribing channels"); | ||
resubscribeChannels(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to call the connectionSuccessEmitters
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move over to PublishSubject for reconnFailEmitters and connectionSuccessEmitters? I know its a little out of scope, but would be nice. Maybe emit the exchange too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funnily enough, I just suggested that on another review! Yes, that seems sensible - it means that subscriptions to those observables could persist between manual reconnects.
This PR will be closed shortly unless there is further activity. |
This project is in the process of being merged into the XChange project and no further PRs will be merged here. Once the projects have been merged, there may be a short stabilization period where there will be large-scale renaming of classes and packages, which may cause conflicts. You are advised to wait at least a week from now and then resubmit your PR on the XChange project. Thank you for your support! |
You can now resubmit your PR on XChange. This project will shortly be marked as archived. |
Currently, the
resubscribeChannels()
is called on every successful connection.This should be necessary only when reconnecting, i.e. in the
scheduleReconnect()
method.