lib/helpers/Childs.js
function(tasksPerProcess) {
  this.ttl = tasksPerProcess;
  this.available = true;

  this.process = fork(__dirname + '/child-process.js', {silent: true});

  this.reset = function() {
    this.process.kill('SIGKILL');
    this.process = fork(__dirname + '/child-process.js', {silent: true});
    this.ttl = tasksPerProcess;
    this.available = true;
  };

  this.clean = function() {
    this.process.removeAllListeners();
    this.process.stdout.removeAllListeners();
    this.process.stderr.removeAllListeners();
  };

  this.terminate = function() {
    this.process.kill('SIGTERM');
  };
}
function(tasksPerProcess) {
  this.ttl = tasksPerProcess;
  this.available = true;

  this.process = fork(__dirname + '/child-process.js', {silent: true});

  this.reset = function() {
    this.process.kill('SIGKILL');
    this.process = fork(__dirname + '/child-process.js', {silent: true});
    this.ttl = tasksPerProcess;
    this.available = true;
  };

  this.clean = function() {
    this.process.removeAllListeners();
    this.process.stdout.removeAllListeners();
    this.process.stderr.removeAllListeners();
  };

  this.terminate = function() {
    this.process.kill('SIGTERM');
  };
}
function ( tasksPerProcess ) { this . ttl = tasksPerProcess ; this . available = true ; this . process = fork ( __dirname + '/child-process.js' , { silent : true } ) ; this . reset = function ( ) { this . process . kill ( 'SIGKILL' ) ; this . process = fork ( __dirname + '/child-process.js' , { silent : true } ) ; this . ttl = tasksPerProcess ; this . available = true ; } ; this . clean = function ( ) { this . process . removeAllListeners ( ) ; this . process . stdout . removeAllListeners ( ) ; this . process . stderr . removeAllListeners ( ) ; } ; this . terminate = function ( ) { this . process . kill ( 'SIGTERM' ) ; } ; }
Manage a child process
Manage a child process