lib/Master.js
/**
   * Used to retrieve slaves.
   * @returns {Array<Slaves>} An array of slaves
   */
Used to retrieve slaves.
@returns {Array} An array of slaves
Used to retrieve slaves . @returns { Array } An array of slaves
get slaves() {
    return {
      get all() {
        return Slave.getAllSlaves();
      },
      get busy() {
        return Slave.getAllBusySlaves();
      },
      get idle() {
        return Slave.getAllIdleSlaves();
      },
      get local() {
        return new SlaveArray(...Slave.getAllSlaves()._.where(s => (s.isRemote === false)));
      },
      get remote() {
        return new SlaveArray(...Slave.getAllSlaves()._.where(s => (s.isRemote === true)));
      },
      idleInList: (...slaveList) => {
        const slaves = flattenSlaveList(true, ...slaveList);
        return new SlaveArray(...slaves._.where(s => s.isIdle));
      },
      get leastBusy() {
        return Slave.getLeastBusy(...Slave.getAllSlaves());
      },
      inGroup: (g) => Slave.getSlavesInGroup(g),
      notInGroup: (g) => {
        const slavesInGroupG = Slave.getSlavesInGroup(g);
        return new SlaveArray(...Slave.getAllSlaves().filter(s => slavesInGroupG.indexOf(s) === -1));
      },
      leastBusyInGroup: (g) => Slave.getLeastBusy(...Slave.getSlavesInGroup(g)),
      leastBusyInList: (...slaveList) => Slave.getLeastBusy(...flattenSlaveList(true, ...slaveList)),
    };
  }
get slaves ( ) { return { get all ( ) { return Slave . getAllSlaves ( ) ; } , get busy ( ) { return Slave . getAllBusySlaves ( ) ; } , get idle ( ) { return Slave . getAllIdleSlaves ( ) ; } , get local ( ) { return new SlaveArray ( ... Slave . getAllSlaves ( ) . _ . where ( s => ( s . isRemote === false ) ) ) ; } , get remote ( ) { return new SlaveArray ( ... Slave . getAllSlaves ( ) . _ . where ( s => ( s . isRemote === true ) ) ) ; } , idleInList : ( ... slaveList ) => { const slaves = flattenSlaveList ( true , ... slaveList ) ; return new SlaveArray ( ... slaves . _ . where ( s => s . isIdle ) ) ; } , get leastBusy ( ) { return Slave . getLeastBusy ( ... Slave . getAllSlaves ( ) ) ; } , inGroup : ( g ) => Slave . getSlavesInGroup ( g ) , notInGroup : ( g ) => { const slavesInGroupG = Slave . getSlavesInGroup ( g ) ; return new SlaveArray ( ... Slave . getAllSlaves ( ) . filter ( s => slavesInGroupG . indexOf ( s ) === - 1 ) ) ; } , leastBusyInGroup : ( g ) => Slave . getLeastBusy ( ... Slave . getSlavesInGroup ( g ) ) , leastBusyInList : ( ... slaveList ) => Slave . getLeastBusy ( ... flattenSlaveList ( true , ... slaveList ) ) , } ; }
Used to retrieve slaves.
Used to retrieve slaves .
/**
       * Gets all slaves
       * @type {Array<Slave>}
       */ /**
       * Gets all busy slaves
       * @type {Array<Slave>}
       */ /**
       * Gets all idle slaves
       * @type {Array<Slave>}
       */ /**
       * @return {SlaveArray} All local slaves.
       */ /**
       * @return {SlaveArray} All remote slaves.
       */ /**
       * Gets the idle slaves in the list of slaves.
       * @param {...String|Number|Slave} slaveList The list of slave to find idle slaves.
       * @return {Array<Slave>} An array of slaves.
       */ /**
       * Gets the least busy slave
       * @type {Slave}
       */ /**
       * Gets all slaves in the given group.
       * @param {String} g The group to get the slaves from.
       * @return {Array<Slave>} An array of slaves.
       */ /**
       * Gets all slaves not in the given group.
       * @param {String} g The group to omit slaves.
       * @return {Array<Slave>} An array of slaves.
       */ /**
       * Gets the least busy slave in the given group.
       * @param {String} g The group to find the least busy slave.
       * @return {Array<Slave>} An array of slaves.
       */ /**
       * Gets the least busy slave in the list of slaves.
       * @param {...String|Number|Slave} slaveList The list of slave to find the least busy from.
       * @return {Array<Slave>} An array of slaves.
       */