node-worker
node-worker copied to clipboard
Raise "close" event when worker processes terminate
Updated pull request that contains alignment fixes, unit tests and usage instructions. Strangely I wasn't able to append the pull request to the existing one.
It'd be incredibly useful to be able to tell when a worker process terminates, to for example spawn a new one, or just log the completion of the process. This patch adds an event that is raised along with the exit code from the process. It does not apply to TCP workers just yet.
Usage:
worker.addListener('close', function(code) {
console.log('Worker child exited with ' + code);
});
cramforce, any updated thoughts on this?