Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise "close" event when worker processes terminate #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chrisboulton
Copy link

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);
});

Chris Boulton added 2 commits September 5, 2010 14:04
…code too. Very useful to intercept and handle quits, but not sure how to apply to TCP worker just yet
@chrisboulton
Copy link
Author

cramforce, any updated thoughts on this?

deathcap added a commit to deathcap/node-worker that referenced this pull request Jan 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant