node-binance-api icon indicating copy to clipboard operation
node-binance-api copied to clipboard

How to terminate futureUserData | Stop the keep alive setTimeout?

Open doppelgunner opened this issue 3 years ago • 0 comments

   let wsEndpoint = null;
   client.userFutureData(null,null,
        data => {
            console.log('data', data);
        },
        endpoint => {
            wsEndpoint = endpoint
        }
    )

    setTimeout(() => {
       client.futuresTerminate(wsEndpoint)
    }, 3000)

But it's still running because of the setTimeout(). I want to be able to stop it fully after terminating the websocket. Also, if the websocket is not yet terminated... then keep the keepalive open... how to achieve this?

doppelgunner avatar Feb 13 '22 21:02 doppelgunner