Open abdullahshahin opened 7 years ago
I don't think setInterval
is the right thing to do here. Could you please share what you had in mind?
make sure all commands have been executed, once terminate is submitted, there is a chance to have some commands are still being processed and the response is not delivered yet, so am setting the interval to keep checking whether its a good time to end the web socket, I have a use case to insert thousands of entries using async.eachLimit and every time I got 50 transitions, the 50 transactions may not delivered in time. I may realize that this could occupy a cpu power, is there any better way we can handle it differently ?
I think my pull request covers this?
enable the client to close the web socket once they're need it, this method will make sure all commands have been done executing and then it will close the socket