smrchy/rsmq

Accept callback to quit() method

ladariha opened this issue · 0 comments

The redis client allows to pass callback when calling quit command, please see https://www.npmjs.com/package/redis#clientquitcallback.

client.quit(callback)
This sends the quit command to the redis server and ends cleanly right after all running commands were properly handled. If this is called while reconnecting (and therefore no connection to the redis server exists) it is going to end the connection right away instead of resulting in further reconnections! All offline commands are going to be flushed with an error in that case.

Unfortunately the rsmq does not accept callback and its method is synchronous so after calling rsmq.quit() so how should we wait for redis connection to be closed? Could you please modify the rsmq.quit() to be asynchronous with possible callback parameter?