Created
September 17, 2010 13:57
-
-
Save jfd/584271 to your computer and use it in GitHub Desktop.
This file contains 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
master.js | |
--- | |
var spawn = require('child_process').spawn; | |
var child = spawn("node", ["child.js"]); | |
console.log("Child %PID ", child.pid); | |
setTimeout(function() { | |
console.log("Shutdown"); | |
process.exit(); | |
}, 1000); | |
child.js | |
--- | |
var i = 0; | |
setInterval(function() { | |
i++; | |
}, 100); | |
Shell | |
--- | |
# Listing the new | |
ps -a | grep %PID | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment