Wednesday 15 April 2015

Automatically re-spawn a ruby script from within node.js when it fails -



Automatically re-spawn a ruby script from within node.js when it fails -

i have node.js app when started spawns ruby script connect streaming info service , captures output via stdout served client via websocket.

every , 1 time again ruby script fail (normally due disconnect far end) , while node script carry on running not aware spawned ruby script has died.

is there way can automate recovery of spawned ruby script within node or ruby don't have restart entire node instance (thus not booting clients off) , script re-spawn attached right instance of node?

the script spawned using following;

var cp = require('child_process'); var tail = cp.spawn('/var/www/html/mapper/test/feed1-db.rb'); tail.stdout.on('data', function(chunk) { #<more stuff here info split , emitted socket>#

ruby node.js

No comments:

Post a Comment