meteor-space / base

Foundation for Modular Application Architecture in Meteor.
MIT License
75 stars 5 forks source link

Process death handling #85

Open rhyslbw opened 8 years ago

rhyslbw commented 8 years ago

In #43 I raised the option of using winston to catch unhandled exceptions, however there are more things to consider like process exit events in order to gain proper control of the production system and perform a graceful shutdown. I've been using an npm package called death that we could use as infrastructure, and then use the module lifecycle hook to allow implementations to define shutdown code.

rhyslbw commented 8 years ago

This would actually be a good way to help shield from sloppy implementation of a process.on('uncaughtException'), as we could call the app's shutdown hook then process.exit along with a log entry