-
Notifications
You must be signed in to change notification settings - Fork 66
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
[question] close real-time stream intentionally #45
Comments
best to add: process.env.DEBUG = 'tardis-dev*' |
just some of connections were closed, here is detail logs: So, a lot of connections are being kept, that leads to the rate limit error. |
I can see the issue, unfortunately don't see an easy way to fix it, the issue is that code assumes that those individual streams push messages frequently and require next message to be pushed for a given connection to be closed. |
@thaaddeus Can you add methods to allow disconnecting the underlying websocket directly ? |
@thaaddeus any updates on methods for intentional disconnects? Due to the lack of disconnect methods on the tardis-node side, an application that uses tardis-node can't gracefully shutdown when receiving such a signal because it can't be sure that the underlying ws connection is properly disconnected. |
I don't have any updates yet, pull requests welcome. |
Agreed with @kovetskiy. The ability to end streams gracefully would be useful. Looking through the code, the obvious approach is wrapping the _stream generator methods in a class is probably the correct approach to expose the close commands on the underlying websockets on the RealTimeStream classes. However, that change would cause a decent amount of breaking changes up to the library interface. A hack might be to just keep a list of the open sockets in an array or object that is exposed to the library client allowing the client to kill the socket but that situation would still need to be handled by the generators. Thanks! |
I've checked this #30, but it seems not working properly.
Consider following code snippet, it basically re-subscribes some symbols to
deribit
exchange every minute. At the end of minute interval, it will break the combined stream --> expect to terminate underlying websockets to deribit. So, spinning new process will not flood thederibit
server.But, at the next iterations,
deribit
return429
error code, that indicates the rate limit error.@thaaddeus do we anyway to shutdown the stream or at least terminate the running websockets ?
The text was updated successfully, but these errors were encountered: