Closed Slurpgoose closed 4 years ago
Hi. Thanks for your interest. Please take a look at https://github.com/aloysius-pgast/bittrex-signalr-client/blob/master/doc/api.md#emitted-events. Events disconnected
and connectionError
are
probably what you're looking for. You don't have anything to do related to the connection in your event handler since re-connection will be automatic
client.on('connectionError', (data) => {
// set flag
});
Thank you so much! I'm sorry for wasting your time, its clearly stated in the docs.
Hi, thank you for your work in creating this library and adding great examples/documentation. I am storing the order book state of all bittrex markets and passing this state to other services in my application on their request through a unix socket.
This library seems to have a good method for reconnecting automatically, but is it currently possible to receive events
on_close
oron_error
?Goal: prevent exporting stale market states to other services
I am thinking I could use an
on_error
event to notify me if socket is attempting to reconnect, then if max_reconnect reached error is emitted then callclient.disconnect()
and initialize a new instance from anon_close
event. As well if the client is reconnecting then to set a flag and wait until 'orderBook' event is passed for all markets before removing the flag.If this is something that is already possible or if you have any ideas for an alternative solution, any help would be greatly appreciated :)