Skip to content

Instantly share code, notes, and snippets.

@jfd
Created September 17, 2010 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfd/584271 to your computer and use it in GitHub Desktop.
Save jfd/584271 to your computer and use it in GitHub Desktop.
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