-
Notifications
You must be signed in to change notification settings - Fork 8
Luke/dpe 3219 candle api trades integration #187
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
Conversation
# Conflicts: # protocol
…scription succeeded
…logic. Fixed bug when cleaning up subscriptions. Added more unit tests.
| } | ||
| } | ||
|
|
||
| this.subscribeToApi(); |
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.
i feel sus about this implementation...
we are subscribing to the API on object creation, but we don't have any information about the subscription from the consumer's POV.
e.g. we do const marketDataApiSubscription = new ApiSubscription(...)
but this code don't know anything about the underlying subscription, whereas we'd usually have something like const subscription = await marketDataApiSubscription.subscribe()
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.
Ok coming back to this yeah the idea was that apisubscription IS A SUBSCRIPTION .. it shouldn't exist without a subscriber/without being subscribed .. so it's got a minimal interface where the only public methods available are to add or remove subscribers (and it will automatically unsubscribe when there are no subscribers left) .. I'll wait to see what you think , I don't think it's that bad tbh 🧐
…allow resetting candles in tvfeed class
…the last subscriber unsubscribes
…tiplex websocket class. Removed previous "health check" logic.
|
|
||
| // Check if we've exceeded the maximum reconnect attempts | ||
| if (this.reconnectAttempts >= this.maxAttemptsCount) { | ||
| throw new Error( |
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.
will it break the UI if the UI doesn't catch this error? is it better to just log the error?
See associated UI changes in this PR :: https://github.com/drift-labs/protocol-v2-mono/pull/3593