lib/Workpool.js
/**
   * Retrieves the next slave that should do work in the workpool.
   * If no slaves are available to do work, then null will be returned.
   * @return {Slave|Null} A slave that's ready for work, or null.
   */
Retrieves the next slave that should do work in the workpool.
If no slaves are available to do work, then null will be returned.
@return {Slave|Null} A slave that's ready for work, or null.
Retrieves the next slave that should do work in the workpool . If no slaves are available to do work then null will be returned . @return { Slave|Null } A slave that ' s ready for work or null .
nextSlave() {
    if (this[workpool].lastIndex === this[workpool].slaves.length - 1) this[workpool].lastIndex = -1;
    const slaves = require('./Master').slaves 
      .idleInList(...this[workpool].slaves);
    let slave;
    if (slaves.length > 1) {
      slave = slaves
      ._.where(s => this[workpool].slaves.indexOf(s) > this[workpool].lastIndex)
      ._.first();
    } else if (slaves.length === 1) {
      slave = slaves[0];
    }
    if (slave) this[workpool].lastIndex = this[workpool].slaves.indexOf(slave);
    return slave || null;
  }
nextSlave ( ) { if ( this [ workpool ] . lastIndex === this [ workpool ] . slaves . length - 1 ) this [ workpool ] . lastIndex = - 1 ; const slaves = require ( './Master' ) . slaves . idleInList ( ... this [ workpool ] . slaves ) ; let slave ; if ( slaves . length > 1 ) { slave = slaves . _ . where ( s => this [ workpool ] . slaves . indexOf ( s ) > this [ workpool ] . lastIndex ) . _ . first ( ) ; } else if ( slaves . length === 1 ) { slave = slaves [ 0 ] ; } if ( slave ) this [ workpool ] . lastIndex = this [ workpool ] . slaves . indexOf ( slave ) ; return slave || null ; }
Retrieves the next slave that should do work in the workpool.
Retrieves the next slave that should do work in the workpool .
// eslint-disable-line global-require