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
- Host: GitHub
- URL: https://github.com/topfreegames/pomelo-graceful-shutdown
- Owner: topfreegames
- License: mit
- Created: 2017-12-18T15:00:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-29T14:59:51.000Z (over 2 years ago)
- Last Synced: 2025-02-20T13:40:18.614Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 69.3 KB
- Stars: 3
- Watchers: 14
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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,
}
})
...
...
})
```