lib/createWorkers.js
function _subscribeToConnectionEvents(connection, workerName) {
    connection.on('close', errCode => {
      logger.info({ workerName, errCode }, '[AMQP] Connection closing, exiting');
      // The workerConnection isn't working anymore...
      workerConnection = null;
      workers.close();
    });
    connection.on('error', err => {
      logger.error({ err, workerName }, '[AMQP] Connection closing because of an error');
    });
    connection.on('blocked', reason => {
      logger.warn({ reason, workerName }, '[AMQP] Connection blocked');
    });
  }
function _subscribeToConnectionEvents(connection, workerName) {
    connection.on('close', errCode => {
      logger.info({ workerName, errCode }, '[AMQP] Connection closing, exiting');
      // The workerConnection isn't working anymore...
      workerConnection = null;
      workers.close();
    });
    connection.on('error', err => {
      logger.error({ err, workerName }, '[AMQP] Connection closing because of an error');
    });
    connection.on('blocked', reason => {
      logger.warn({ reason, workerName }, '[AMQP] Connection blocked');
    });
  }
function _subscribeToConnectionEvents ( connection , workerName ) { connection . on ( 'close' , errCode => { logger . info ( { workerName , errCode } , '[AMQP] Connection closing, exiting' ) ; // The workerConnection isn't working anymore... workerConnection = null ; workers . close ( ) ; } ) ; connection . on ( 'error' , err => { logger . error ( { err , workerName } , '[AMQP] Connection closing because of an error' ) ; } ) ; connection . on ( 'blocked' , reason => { logger . warn ( { reason , workerName } , '[AMQP] Connection blocked' ) ; } ) ; }
Bind a logger to noticeable connection events
@param {Object} connection the connection objext
@param {String} workerName worker name
@returns {*} -
@private
Bind a logger to noticeable connection events