by latchkey · 13y ago · 0 comments
I also tie the worker PID to each user's session, so they can't spawn an infinite number of workers and cause serious strain on the server -- the server just kills the previous worker and spawns a new one if it's asked to run the function again.
I was actually thinking about opensourcing this, but I guess it's pointless now that domains basically do what I hacked together.
process.on('uncaughtException', function (err) {
// log it
});"Don't use it, use domains instead. If you do use it, restart your application after every unhandled exception!"
http://nodejs.org/api/process.html#process_event_uncaughtexc...