hemera-graceful-shutdown

4.0.2 • Public • Published

Hemera-graceful-shutdown package

npm styled with prettier

Shutdown Hemera graceful asynchronously. By default the hemera onClose hook is called when SIGINT or SIGTERM was triggered.

Usage

const hemera = new Hemera(nats)
hemera.use(require('hemera-graceful-shutdown'))
hemera.gracefulShutdown((signal, next) => {
  next()
})

Plugin decorators

  • .gracefulShutdown(Function handler)

Caveats

  • Don't register signal handlers otherwise except with this plugin.
  • Use hemera onClose hook to release resources in your plugin.
  • The process will be exited after a certain timeout (Default 10 seconds) to protect against stuck process.

Readme

Keywords

none

Package Sidebar

Install

npm i hemera-graceful-shutdown

Weekly Downloads

1

Version

4.0.2

License

MIT

Unpacked Size

5.22 kB

Total Files

6

Last publish

Collaborators

  • starptech