index.js
function addWorker(worker, cb) {
    function ping() {
      // A thing to keep in mind that right now it can take very long
      // (I think default is 22222 ms) for a request to time out, even
      // in scenarios like remote side breaking the connection and
      // ECONNREFUSED on reconnect.
      madeWorker.seneca.act({ role: 'transport', cmd: 'ping' }, function (err) {
        worker.up = !isTaskTimeout(err)
      })
    }

    if (!worker.id) worker.id = nid()
    var madeWorker = makeWorker(worker)
    madeWorker.pingInterval = setInterval(ping, opts.pingInterval || 1000)
    ping()
    workers.push(madeWorker)
    cb(null, madeWorker)
  }
function addWorker(worker, cb) {
    function ping() {
      // A thing to keep in mind that right now it can take very long
      // (I think default is 22222 ms) for a request to time out, even
      // in scenarios like remote side breaking the connection and
      // ECONNREFUSED on reconnect.
      madeWorker.seneca.act({ role: 'transport', cmd: 'ping' }, function (err) {
        worker.up = !isTaskTimeout(err)
      })
    }

    if (!worker.id) worker.id = nid()
    var madeWorker = makeWorker(worker)
    madeWorker.pingInterval = setInterval(ping, opts.pingInterval || 1000)
    ping()
    workers.push(madeWorker)
    cb(null, madeWorker)
  }
function addWorker ( worker , cb ) { function ping ( ) { // A thing to keep in mind that right now it can take very long // (I think default is 22222 ms) for a request to time out, even // in scenarios like remote side breaking the connection and // ECONNREFUSED on reconnect. madeWorker . seneca . act ( { role : 'transport' , cmd : 'ping' } , function ( err ) { worker . up = ! isTaskTimeout ( err ) } ) } if ( ! worker . id ) worker . id = nid ( ) var madeWorker = makeWorker ( worker ) madeWorker . pingInterval = setInterval ( ping , opts . pingInterval || 1000 ) ping ( ) workers . push ( madeWorker ) cb ( null , madeWorker ) }
Add a new worker.
Add a new worker .