On Mar 22, 12:51 am, dshaw <[email protected]> wrote:
> var exec = require('child_process').exec;
exec's callback is executed when the process exits. spawn() is what
emits the exit event. or instead of using spawn, just call respawn()
inside exec's callback.
Simplest way to respawn with spawn():
var spawn = require('child_process').spawn;
function respawn() {
spawn('myprogram').on('exit', respawn);
}
Simplest way to respawn with exec():
var exec = require('child_process').exec;
function respawn() {
exec('myprogram', respawn);
}
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en