src/workers/workerpool.js
function WorkerPool(options) {
  if (!(this instanceof WorkerPool))
    return new WorkerPool(options);

  EventEmitter.call(this);

  this.enabled = false;
  this.size = getCores();
  this.timeout = 120000;
  this.file = process.env.WMCC_WORKER_FILE || 'worker.js';

  this.children = new Map();
  this.uid = 0;

  this.set(options);
}
function WorkerPool(options) {
  if (!(this instanceof WorkerPool))
    return new WorkerPool(options);

  EventEmitter.call(this);

  this.enabled = false;
  this.size = getCores();
  this.timeout = 120000;
  this.file = process.env.WMCC_WORKER_FILE || 'worker.js';

  this.children = new Map();
  this.uid = 0;

  this.set(options);
}
function WorkerPool ( options ) { if ( ! ( this instanceof WorkerPool ) ) return new WorkerPool ( options ) ; EventEmitter . call ( this ) ; this . enabled = false ; this . size = getCores ( ) ; this . timeout = 120000 ; this . file = process . env . WMCC_WORKER_FILE || 'worker.js' ; this . children = new Map ( ) ; this . uid = 0 ; this . set ( options ) ; }
A worker pool.
@alias module:workers.WorkerPool
@constructor
@param {Object} options
@param {Number} [options.size=num-cores] - Max pool size.
@param {Number} [options.timeout=120000] - Execution timeout.
@property {Number} size
@property {Number} timeout
@property {Map} children
@property {Number} uid
A worker pool .