Releases: transcovo/node-amqp-bus
Releases · transcovo/node-amqp-bus
Release list
Handling client connection `close` event
This release improves how apps handle when the client connection to the server is closed abruptly (such as a restart of the rabbitmq server), by exiting the current process, while giving the app ways to cleanup properly.
(the orchestrator of the env. should then spawn a new instance instead)
Added:
Client EventEmitter interface:
close_cleanup: emitted once, when handling acloseconnection event.
It provides a timeout (defaut =200ms) before executing aclient.close(forceClose = true),
for the host app to execute any cleanup operations (such as closing amongodbclient).
Client options:
- @PARAM {Number|undefined} [options.processExitCleanupTimeout] :
the time in ms that is (at least) waited for close cleanup operations. (default:200ms) - @PARAM {Number|undefined} [options.processExitTimeout] :
the time in ms that is (at least) waited before exiting process. (default:0ms)
Changes:
client.close(forceClose = false)
Closes the client. Returns a Promise. When passing a truthyforceClose,close()will alsoexit(1) the current process, so when handling erroneous case that you can't recover from, one should callclose(true).