Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var fork = require('child_process').fork;
if (process.argv[2] === 'child') {
setInterval(function () {
console.log('alive ... ');
}, 200);
setTimeout(function () {
console.log('exit child');
process.exit(0);
process.exit(0);
}, 500);
} else {
var child = fork(process.argv[1], ['child'], {thread: true});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.