Created
February 1, 2012 20:10
-
-
Save AndreasMadsen/1719044 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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