pomelo-graceful-shutdown

0.2.13 • Public • Published

Pomelo Graceful Shutdown Component

Example Usage

Make pomelo use the component:

var GracefulShutdown = require('pomelo-graceful-shutdown')

...
...

app.configure('all', 'connector', function(){
  ...
  ...
  app.use(GracefulShutdown, {
    gracefulShutdown: {
      checks: [
        () => {
          if (app.numRooms > 0) {
            return false;
          }
          return true
        }
      ],
      signals: ['SIGTERM'],
      before: () => {
        console.log("before")
      },
      shouldExit: true,
      timeout: 30,
    }
  })
  ...
  ...
})

Package Sidebar

Install

npm i pomelo-graceful-shutdown

Weekly Downloads

1

Version

0.2.13

License

MIT

Unpacked Size

108 kB

Total Files

20

Last publish

Collaborators

  • tfgco