Creates a new subscription to a queue
@param queue {string}
@constructor
483649
function Subscription (queue, options) {
        assert.object(queue, 'queue');
        assert.object(options, 'options');

        this.MAX_DISPOSE_RETRIES = 3;
        this.retryDelay = 1000;
        this.queue = queue;
        this.options = options;
        this._disposed = false;
    }
1144648
function (fn) {
  var container = this;

  var program = function () {
    var subscriber = new Subscription(fn, null, container);
    return subscriber.execute.apply(subscriber, arguments);
  };

  Utils.extend(program, fn);

  return program;
}
109085
public Queue createDeadletterQueue(final String queueName) {
        return new Queue(queueName, true, false, false, getTTLArgs());
    }
645858
def create(self):
        
        self.logger.debug('Create subscription on server...')

        if not self.connection.connected:
            self.state = 'connection_pending'
            return

        data = {
            'command': 'subscribe',
            'identifier': self._identifier_string()
        }

        self.connection.send(data)
        self.state = 'pending'
868359
function queueOrRequest( el ){
			var url = el.data( "url" );
			if( o.proxy && $.inArray( url, urllist ) === -1 ){
				urllist.push( url );
				elQueue = elQueue.add( el );
			}
			else{
				AI.makeReq( url, el );
			}
		}
502163
def create(self):
        
        self.queue = self.scheduler.queue.addSubQueue(self.priority, LockEvent.createMatcher(self.context, self.key),
                                         maxdefault = self.size, defaultQueueClass = CBQueue.AutoClassQueue.initHelper('locker', subqueuelimit = 1))
224421
function() {
        activemq = new PodActiveMQ({
          username: params.queueUsername,
          password: params.queuePassword,
          host: params.queueHost,
          port: params.queuePort,
          timeout: params.queueConnectionTimeout
        });

        activemq.on("init", function() {
          fireEvent("asyncReady");

          socketState = socketStateType.OPEN;
          fireEvent("stateChange", {
            queueState: socketState
          });

          pushSendDataQueueHandler();

          activemq.subscribe({
            destination: params.queueReceive,
            ack: "client-individual"
          }, function(message) {
            handleSocketMessage(JSON.parse(message));
            if (onReceiveLogging) {
              asyncLogger("Receive", JSON.parse(message));
            }
          });

        });

        activemq.on("error", function(msg) {
          fireEvent("error", msg);

          socketState = socketStateType.CLOSED;

          fireEvent("stateChange", {
            queueState: socketState
          });
        })
      }
448207
@Inject
    public void setQueue(EventQueue queue) {
        if (epi == null) {
            MessageToEventMapper mapper = new MessageToEventMapper();
            mapper.setMaxContentLength(maxContentLength);

            epi = new EventProducerInterceptor(mapper, queue);
        }
    }
185612
function Queue (name, redisClient) {
  this.hasQuit = false
  this._name = name
  this.redisClient = redisClient
  this._key = Queue.PREFIX + this.name
}
54711
function processQueue( self, queuedEvents ) {
   return queuedEvents.map( eventItem => {
      const meta = eventItem.meta;
      self.currentCycle_ = meta.cycleId;

      const subscribers = findSubscribers( self, meta.name );
      if( subscribers.length === 0 ) {
         self.currentCycle_ = -1;
         return eventItem.resolvePublish;
      }

      let serializedEvent = null;
      if( subscribers.length > 1 ) {
         serializedEvent = JSON.stringify( eventItem.event );
      }

      const senderName = meta.sender;
      const options = meta.options;

      subscribers.forEach( subscriberItem => {
         const subscriberName = subscriberItem.subscriberName;
         if( !options.deliverToSender && senderName && senderName === subscriberName ) {
            return;
         }

         try {
            let event;
            if( subscriberItem.options.clone ) {
               event = serializedEvent ? JSON.parse( serializedEvent ) : eventItem.event;
            }
            else {
               event = eventItem.event;
            }
            subscriberItem.subscriber( event, meta );
         }
         catch( e ) {
            const message = `error while calling subscriber "${subscriberName}"` +
               ` for event ${meta.name}` +
               ` published by "${senderName}" (subscribed to: ${subscriberItem.name})`;
            self.errorHandler_( message, {
               'Exception': e,
               'Published event': eventItem.event,
               'Event meta information': meta,
               'Caused by Subscriber': subscriberItem
            } );
         }

         notifyInspectors( self, {
            action: 'deliver',
            source: senderName,
            target: subscriberName,
            event: meta.name,
            eventObject: eventItem.event,
            subscribedTo: subscriberItem.name,
            cycleId: meta.cycleId
         } );
      } );

      self.currentCycle_ = -1;

      return eventItem.resolvePublish;
   } );
}
901771
def queue(name = '', opts = {})
      queue = @connection.find_queue(name) || Queue.new(self, name, opts)
      @connection.register_queue queue
    end
1162599
def start
      queue = ::Queue.new

      @thread = Thread.start do
        @listener_redis.subscribe(@channel, @my_channel) do |on|
          on.subscribe do |channel|
            queue.push(:subscribed) if channel == @channel
          end

          on.message do |channel, message|
            handle_message(channel, message)
          end
        end
      end

      queue.pop
    end
1074964
function(id) {
        var q = queues[id];
        if (q.onTimeout) {
            var sc=q.scope || q;
            q.onTimeout.call(sc, _returnData(q));
        }
    }
974859
function addToQueue(queue, packageInfo) {
  var exists;

  function matchesVersion(version, range) {
    var matches;

    try {
      matches = semver.satisfies(packageInfo.version, item.version);
    }
    catch (err) {
      matches = false;
    }

    return matches;
  }

  exists = queue.some(function(item) {
    var matches = false;

    if (item.name === packageInfo.name) {
      matches = matchesVersion(packageInfo.version, item.version);
    }

    return matches;
  });

  if (!exists) {
    queue.push(packageInfo);
  }
}
1015693
function NativePushQueue(obj) {
  if (!(this instanceof NativePushQueue)) {
    return new NativePushQueue(obj);
  }

  obj = obj || {};

  this.name = obj.name || '';
  this.type = 'push';
  this.queue = obj.queue || null;
}
1212547
public void add(Object msg, ChannelPromise promise) {
        assert ctx.executor().inEventLoop();
        if (msg == null) {
            throw new NullPointerException("msg");
        }
        if (promise == null) {
            throw new NullPointerException("promise");
        }
        // It is possible for writes to be triggered from removeAndFailAll(). To preserve ordering,
        // we should add them to the queue and let removeAndFailAll() fail them later.
        int messageSize = size(msg);

        PendingWrite write = PendingWrite.newInstance(msg, messageSize, promise);
        PendingWrite currentTail = tail;
        if (currentTail == null) {
            tail = head = write;
        } else {
            currentTail.next = write;
            tail = write;
        }
        size ++;
        bytes += messageSize;
        tracker.incrementPendingOutboundBytes(write.size);
    }
658476
function enqueue(){
		var tasks = argumentFilter(arguments);
		queued.push({ tasks:tasks });
		// Timeout needed to increment expected, if next item exists.
		// If it run without timeout, expected always be 0 and the functions
		// will be executed immediately obtaining undefined as parameter.
		setTimeout(function(){if (! expected) runQueue();},1);
		return enqueue;
	}