Skip to content

PomeloLibrary/pomelo-graceful-shutdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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,
    }
  })
  ...
  ...
})

About

A pomelo component that handles graceful shutdown logics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 74.0%
  • Shell 11.0%
  • Dockerfile 9.1%
  • Makefile 5.9%