An open API service indexing awesome lists of open source software.

https://github.com/topfreegames/pomelo-graceful-shutdown

A pomelo component that handles graceful shutdown logics
https://github.com/topfreegames/pomelo-graceful-shutdown

Last synced: 7 months ago
JSON representation

A pomelo component that handles graceful shutdown logics

Awesome Lists containing this project

README

          

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