Imagine you want to be able to terminate your Node.js app and drain all existing connections before quitting, you might come up with a solution as outlined here:
http://blog.argteam.com/coding/hardening-node-js-for-production-part-3-zero-downtime-deployments-with-nginx
e.g.
- respond to SIGTERM or SIGINT events
- tell your Express app to stop accepting new connections
- get called back by Express when the last connection has been serviced
This would all you to do graceful deployments of new code without terminating existing requests (assuming your load balancer sends traffic to other servers).
As of Express 3, the app.close() method seems to have disappeared, which means Express users have no means of gracefully stopping an application as far as I can see.
Imagine you want to be able to terminate your Node.js app and drain all existing connections before quitting, you might come up with a solution as outlined here:
http://blog.argteam.com/coding/hardening-node-js-for-production-part-3-zero-downtime-deployments-with-nginx
e.g.
This would all you to do graceful deployments of new code without terminating existing requests (assuming your load balancer sends traffic to other servers).
As of Express 3, the app.close() method seems to have disappeared, which means Express users have no means of gracefully stopping an application as far as I can see.