Closed kenchambers closed 1 year ago
Small tip, you can also set the client to use the US domain via the domain
property:
https://github.com/tiagosiebler/ftx-api/blob/8990f20b6bcb2968c77cf80c394a5b6db489bd8c/src/util/requestUtils.ts#L51
I'm surprised the wsclient.close()
didn't do the trick, will need to investigate that. Thanks for reporting it.
Would a teardown
or teardownAll
method on the ws client be helpful, specifically to close and clean up everything?
absolutely!
thanks for response.
Or maybe a flag that you can pass into the client that would disable reconnect. since it is by default set ?
absolutely!
thanks for response.
Or maybe a flag that you can pass into the client that would disable reconnect. since it is by default set ?
Or both might be nice in this case. Would also avoid the confusion of managing all the close(closewhat)
calls
Another library I saw has this:
turnOffStream() {
let endpoints = this.binanceWs.websockets.subscriptions();
for (let endpoint in endpoints) {
this.binanceWs.websockets.terminate(endpoint);
}
}
as well as the ability to pass a disable for reconnect:
const binanceWs = new Binance({
APIKEY: this.apiKey,
APISECRET: this.apiSecret,
reconnect: false,
});
I noticed that after I instantiate (the websocket) client, and then try to
ws.close
I am still connected. Is it possible to terminate connection completely? I am asking because I am opening WS inside of a background job and I am trying to avoid memory leaks:pseudo code repro:
as you can see, connection is not closing: