src/tasks_manager/task_manager.js
function(opts) {
  if (!opts) opts = {};

  this.port_offset        = opts.port_offset ? parseInt(opts.port_offset) : 10001;
  this.task_list          = {};
  this.can_accept_queries = false;
  this.can_local_compute  = true;
  this.app_folder         = opts.app_folder;

  var pm2_opts = {};

  if (process.env.NODE_ENV == 'test') {
    pm2_opts = {
      independent : true,
      daemon_mode : true
    };
  }

  this.pm2 = new PM2.custom(pm2_opts);

  // Defaults values
  this.task_meta   = {
    instances   : 0,
    json_conf   : null,
    task_folder : 'tasks',
    env         : {}
  };

  if (opts.task_meta)
    this.task_meta = opts.task_meta;

  this.controller = Controller;
}
function(opts) {
  if (!opts) opts = {};

  this.port_offset        = opts.port_offset ? parseInt(opts.port_offset) : 10001;
  this.task_list          = {};
  this.can_accept_queries = false;
  this.can_local_compute  = true;
  this.app_folder         = opts.app_folder;

  var pm2_opts = {};

  if (process.env.NODE_ENV == 'test') {
    pm2_opts = {
      independent : true,
      daemon_mode : true
    };
  }

  this.pm2 = new PM2.custom(pm2_opts);

  // Defaults values
  this.task_meta   = {
    instances   : 0,
    json_conf   : null,
    task_folder : 'tasks',
    env         : {}
  };

  if (opts.task_meta)
    this.task_meta = opts.task_meta;

  this.controller = Controller;
}
function ( opts ) { if ( ! opts ) opts = { } ; this . port_offset = opts . port_offset ? parseInt ( opts . port_offset ) : 10001 ; this . task_list = { } ; this . can_accept_queries = false ; this . can_local_compute = true ; this . app_folder = opts . app_folder ; var pm2_opts = { } ; if ( process . env . NODE_ENV == 'test' ) { pm2_opts = { independent : true , daemon_mode : true } ; } this . pm2 = new PM2 . custom ( pm2_opts ) ; // Defaults values this . task_meta = { instances : 0 , json_conf : null , task_folder : 'tasks' , env : { } } ; if ( opts . task_meta ) this . task_meta = opts . task_meta ; this . controller = Controller ; }
The Task Manager manage Tasks and PM2
@constructor
@param {Object}  opts options
@param {Integer} opts.port_offset Port to start on
@param {String}  opts.app_folder application to cwd to
The Task Manager manage Tasks and PM2