lib/queue-machine.js
function(callback, options) {
      return new Promise((resolve, reject) => {
        let op = () => {
          return this.channel.subscribe(callback, options)
            .then(resolve, reject);
        };
        this.on('failed', function(err) {
          reject(err);
        }).once();
        this.handle('subscribe', op);
      });
    }
function(callback, options) {
      return new Promise((resolve, reject) => {
        let op = () => {
          return this.channel.subscribe(callback, options)
            .then(resolve, reject);
        };
        this.on('failed', function(err) {
          reject(err);
        }).once();
        this.handle('subscribe', op);
      });
    }
function ( callback , options ) { return new Promise ( ( resolve , reject ) => { let op = ( ) => { return this . channel . subscribe ( callback , options ) . then ( resolve , reject ) ; } ; this . on ( 'failed' , function ( err ) { reject ( err ) ; } ) . once ( ) ; this . handle ( 'subscribe' , op ) ; } ) ; }
Subscribe to the queue

@public
@memberOf QueueMachine.prototype
@param {Function} callback - the function to be called with each message
@param {Object} options - details in consuming from the queue
@param {Number} options.limit - the channel prefetch limit
@param {bool} options.noBatch - if true, ack/nack/reject operations will execute immediately and not be batched
@param {bool} options.noAck - if true, the broker won't expect an acknowledgement of messages delivered to this consumer; i.e., it will dequeue messages as soon as they've been sent down the wire. Defaults to false (i.e., you will be expected to acknowledge messages).
@param {String} options.consumerTag - a name which the server will use to distinguish message deliveries for the consumer; mustn't be already in use on the channel. It's usually easier to omit this, in which case the server will create a random name and supply it in the reply.
@param {bool} options.exclusive - if true, the broker won't let anyone else consume from this queue; if there already is a consumer, there goes your channel (so usually only useful if you've made a 'private' queue by letting the server choose its name).
@param {Number} options.priority - gives a priority to the consumer; higher priority consumers get messages in preference to lower priority consumers. See this RabbitMQ extension's documentation
@param {Object} options.arguments -  arbitrary arguments. Go to town.
@returns {Promise} a promise that is fulfilled when the subscription is active
Subscribe to the queue