-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Stream]Multiple NettyStreamingService error and (re)connection handling #3537
Comments
The way I see it at a high level the reason Gemini is a little different to implement this with is, that rather then connect to a base url e.g. What was done in the codebase to compensate for this shortcoming was have One way I see about doing this is to maybe have an overloaded method The other way would be something along the lines of exposing the objects you need from |
Binance does the same thing. |
There was some discussion about this when the private streaming services were added. It's really not hard to make the API emit signals for both (just I think the API should probably be more like: public Observable<StreamState> state(); where enum StreamState {
DISCONNECTED,
PARTIALLY_CONNECTED,
CONNECTED
} Then the implementation can do something like this: AtomicReference<State> service1State = new AtomicReference();
AtomicReference<State> service2State = new AtomicReference();
return Observable.merge(
service1.state().doOnNext(service1State::set),
service2.state().doOnNext(service2State::set))
.map(__ -> combineStates(service1State.get(), service2State.get()); Where Obviously this would change a bit if you have I'm sure we could come up with endless variations on this theme. |
I like the way this is going. Can we now extend this cover re-connections?
|
And maybe add READY, once client re-initialize after connect has been complete?
|
@badgerwithagun this is a pretty elegant solution, @mdvx what would be the difference in application state for |
Just that some post connect code had run, in truth i could be before state goes to connected |
excpect the post connect code might only run if it is connected. In my case, i would rebuild my caches here, so this code should return a Completable. |
maybe there are two READY states, on per connection, and one for the aggregate ALL_READY? |
Yea if it really necessary to have a state differentiator to effectively say connected state vs connected state where post connect hooks have ran it it makes sense but if we that isn't necessary I would err on the side of less states. I would imagine you either just transition to Why would you want the |
ALL_READY is exchange level, it just means all the connections are READY, and none are still DISCONNECTED (or connecting, or unready) |
In this case what state would get us in READY but not in ALL_READY? |
READY is at connection level, instead? Client may not know how many connection are needed to support his subscriptions, maybe 1, maybe 2, maybe many more.
From: Erick Arce <[email protected]>
Sent: Monday, May 25, 2020 6:12 PM
To: knowm/XChange <[email protected]>
Cc: Marc Deveaux <[email protected]>; Mention <[email protected]>
Subject: Re: [knowm/XChange] [Stream]Multiple NettyStreamingService error and (re)connection handling (#3537)
In this case what state would get us in READY but not in ALL_READY?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#3537 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAUKUFYYJZHYLIBAEJWRM6LRTLUJRANCNFSM4NJST75A> . <https://github.com/notifications/beacon/AAUKUF7DNOBDU3QPGPCI25TRTLUJRA5CNFSM4NJST75KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEXC7CPI.gif>
|
Right now, I can't implement
class GeminiStreamingExchange { @Override public Observable<Throwable> reconnectFailure() { return streamingService.subscribeReconnectFailure(); } @Override public Observable<Object> connectionSuccess() { return streamingService.subscribeConnectionSuccess(); } }
Because Gemini is using several GeminiProductStreamingService (which derives from [Json]NettyStreamingService) instead of a single JsonNettyStreamingService
private Map<CurrencyPair, GeminiProductStreamingService> productStreamingServices;
This also applies to other services which have two JsonNettyStreamingService instances (one for market data one for private data).
Any thoughts, on how we can aggregate these events across multiple instances?
Originally posted by @mdvx in #3533 (comment)
The text was updated successfully, but these errors were encountered: