index.js
function nextWorker(cb) {
    seneca.act('role:loadbalance,hook:balance', {
      workers: workers,
      lastWorker: lastWorker
    }, function (err, worker) {
      if (!worker) return cb(new Error('No up backend found'))
      lastWorker = worker
      cb(null, worker)
    })
  }
function nextWorker(cb) {
    seneca.act('role:loadbalance,hook:balance', {
      workers: workers,
      lastWorker: lastWorker
    }, function (err, worker) {
      if (!worker) return cb(new Error('No up backend found'))
      lastWorker = worker
      cb(null, worker)
    })
  }
function nextWorker ( cb ) { seneca . act ( 'role:loadbalance,hook:balance' , { workers : workers , lastWorker : lastWorker } , function ( err , worker ) { if ( ! worker ) return cb ( new Error ( 'No up backend found' ) ) lastWorker = worker cb ( null , worker ) } ) }
Get the next worker by asking the `balance` hook for one. Default one is round robin, as implemented in `roundRobin`.
Get the next worker by asking the balance hook for one . Default one is round robin as implemented in roundRobin .