enqueue an element to the next spot in the queue.
17514
function(element, check, go) {
      var shouldAdd = element.__queue && !element.__queue.check;
      if (shouldAdd) {
        queueForElement(element).push(element);
        element.__queue.check = check;
        element.__queue.go = go;
      }
      return (this.indexOf(element) !== 0);
    }
923033
def put(self, item, block=True, timeout=None):
        """"""
        return self._queue.put(item, block, timeout)
1090112
def _next_job(self):
        """"""
        if self.__job_queue:
            # Produce message from the top of the queue
            job = self.__job_queue.pop()
            # logging.debug("queue = %s, popped %r", self.__job_queue, job)
            job.process()
1039984
function runNext() {
	if (this.locked) return false;

    var item = this.queue[0];
    if (!item) return false;

    if (item.exclusive) {
        if (this.running) return false;
        this.locked = true;
    }

    this.queue.shift();

    this.running++;

	var self = this;
	item.fn.call(item.ctx).then(function(res) {
		runDone.call(self, item, true, res);
	}, function(err) {
		runDone.call(self, item, false, err);
	});

	return true;
}
358638
def enqueue(self, name, value, valueType=None, stamp=None):
    """"""
    # If queue is too large, refuse to log.
    if self.maxQueueSize and self.queue.qsize() > self.maxQueueSize:
      return
    # Stick arguments into the queue
    self.queue.put((name, value, valueType, stamp))
371578
function enqueueEvent( self, eventItem ) {
   if( self.eventQueue_.length === 0 ) {
      self.nextTick_( () => {
         const queuedEvents = self.eventQueue_;

         self.eventQueue_ = [];

         processWaitingPublishPromises( self, processQueue( self, queuedEvents ) );
      } );
   }
   self.eventQueue_.push( eventItem );
}
279170
public void push(int element) {
    if (element < 0)
      throw new IllegalArgumentException("Cannot add negative integers to the priority queue");
    assert !this.contains(element);
    this.doImport(element);
    this.pos.set(element, this.heap.size());
    this.heap.push(element);
    assert this.heap.get(this.pos.get(element)) == element;
    this.up(element);
  }
710376
def enqueue(self, stream_url, offset=0, opaque_token=None):
        """"""
        directive = self._play_directive('ENQUEUE')
        audio_item = self._audio_item(stream_url=stream_url,
                                      offset=offset,
                                      push_buffer=False,
                                      opaque_token=opaque_token)
        audio_item['stream']['expectedPreviousToken'] = current_stream.token

        directive['audioItem'] = audio_item
        self._response['directives'].append(directive)
        return self
1083636
def move(self, queue, delay=0, depends=None):
        ''''''
        logger.info('Moving %s to %s from %s',
            self.jid, queue, self.queue_name)
        return self.client('put', self.worker_name,
            queue, self.jid, self.klass_name,
            json.dumps(self.data), delay, 'depends', json.dumps(depends or [])
        )
809814
void runMoreOnKeyQueueOrStop(K key) {
    EntryEvent<K,V> _event;
    synchronized (getLockObject(key)) {
      Queue<EntryEvent<K,V>> q = keyQueue.get(key);
      if (q.isEmpty()) {
        keyQueue.remove(key);
        return;
      }
      _event = q.remove();
    }
    List<Listener<K,V>> _listeners =
      new ArrayList<Listener<K, V>>(asyncListenerByType.get(_event.getEventType()));
    if (_listeners.isEmpty()) {
      runMoreOnKeyQueueOrStop(key);
      return;
    }
    runAllListenersInParallel(_event, _listeners);
  }
1307719
private void nextQueue()
  {
    if(super.hasNext())
    {      
      do
      {
        if(_currentSubIterator != null) _currentSubIterator.finished();
        _currentSubIterator = null;
        _currentQueue = (SIMPQueueControllable) super.next();
        
        try
        {
          _currentSubIterator = _currentQueue.getRemoteQueuePointIterator();
        }
        catch (SIMPException e) 
        {
          // No FFDC code needed
        
          if (tc.isDebugEnabled())
            SibTr.exception(tc, e);          
        }       
      }
      // Retry if we failed to get an iterator, that iterator does not
      // have any remote queue points in it and we have more queues available.
      while((_currentSubIterator == null || !_currentSubIterator.hasNext())
        && super.hasNext());
    }
    else
    {
      _currentQueue = null;
      if(_currentSubIterator != null) _currentSubIterator.finished();
      _currentSubIterator = null;
    }
  }
362127
function(callee, input) {
		for (var i = 0, len = this._queue.length; i < len; ++i)
			input = this._queue[i].call(callee, input);
		return input;
	}
660903
def setPriority(self, queue, priority):
        '''
        
        '''
        q = self.queueindex[queue]
        self.queues[q[0]].removeSubQueue(q[1])
        newPriority = self.queues.setdefault(priority, CBQueue.MultiQueue(self, priority))
        q[0] = priority
        newPriority.addSubQueue(q[1])
79754
def re_enqueue(self, item):
        """"""
        if 'retries' in item:
            retries = item['retries']
            if retries >= self.MAX_RETRIES:
                log.warn("Failed to execute {} after {} retries, give it "
                         " up.".format(item['method'], retries))
            else:
                retries += 1
                item['retries'] = retries
                self._q.put_nowait(item)
        else:
            item['retries'] = 1
            self._q.put_nowait(item)
364648
def move(self, queue_item, status):
        

        items = self.__get_var("items_" + queue_item.status)

        del items[queue_item.get_hash()]
        self.count_total -= 1

        queue_item.status = status
        self.add(queue_item)
950140
function(element) {
      var readied = this.remove(element);
      if (readied) {
        element.__queue.flushable = true;
        this.addToFlushQueue(readied);
        this.check();
      }
    }
861859
def iterqueue(queue, expected):
    """"""
    while expected > 0:
        for item in iter(queue.get, EXIT):
            yield item
        expected -= 1