lib/manager.js
function kill(req, res) {
  if(!this._busy || !this.ps) return res.send(NotBusy);
  if(this._busy && this._written) return res.send(Unkillable);
  this.ps.removeAllListeners();
  this._busy = false;
  this._written = false;
  function onClose() {
    res.send(null, Constants.OK);
    // re-spawn for next execution
    //this.spawn();
  }
  this.ps.once('close', onClose.bind(this))
  process.kill(this.ps.pid, 'SIGQUIT');
  this.emit('kill');
}
function kill(req, res) {
  if(!this._busy || !this.ps) return res.send(NotBusy);
  if(this._busy && this._written) return res.send(Unkillable);
  this.ps.removeAllListeners();
  this._busy = false;
  this._written = false;
  function onClose() {
    res.send(null, Constants.OK);
    // re-spawn for next execution
    //this.spawn();
  }
  this.ps.once('close', onClose.bind(this))
  process.kill(this.ps.pid, 'SIGQUIT');
  this.emit('kill');
}
function kill ( req , res ) { if ( ! this . _busy || ! this . ps ) return res . send ( NotBusy ) ; if ( this . _busy && this . _written ) return res . send ( Unkillable ) ; this . ps . removeAllListeners ( ) ; this . _busy = false ; this . _written = false ; function onClose ( ) { res . send ( null , Constants . OK ) ; // re-spawn for next execution //this.spawn(); } this . ps . once ( 'close' , onClose . bind ( this ) ) process . kill ( this . ps . pid , 'SIGQUIT' ) ; this . emit ( 'kill' ) ; }
Kill a running script.
Kill a running script .