Execute actions in series.

@param {Queue} queue - The queue instance.
@param {object} item - The queued item to be executed.
@returns {void}
492233
function dequeue(queue, item) {
    queue[SIZE] -= 1

    let done = false
    item.action(() => {
        if (done) {
            return
        }
        done = true

        if (item.next) {
            dequeue(queue, item.next)
        }
        else {
            assert(queue[TAIL] === item, "BROKEN")
            queue[TAIL] = null
        }
    })
}
1222022
function(item, callback) {
                if (hasCache && typeof queueDb == 'object') {
                    queueDb.waitQ.where('uniqueId')
                        .equals(item.uniqueId)
                        .and(function(item) {
                            return item.owner == parseInt(userInfo.id);
                        })
                        .delete()
                        .then(function() {
                            callback && callback();
                        })
                        .catch(function(error) {
                            fireEvent('error', {
                                code: error.code,
                                message: error.message,
                                error: error
                            });
                        });
                }
                else {
                    for (var i = 0; i < chatWaitQueue.length; i++) {
                        if (chatWaitQueue[i].uniqueId == item.uniqueId) {
                            chatWaitQueue.splice(i, 1);
                        }
                    }
                    callback && callback();
                }
            }
769202
function JobQueueActivate(queue, callback, timeout) {
        setTimeout(function () {queue.push (null, callback);}, timeout); // wait 5S before start
    }
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)
1137607
def queue_push(object)
      queue_item = QueueItem.new( :kind => "push",
                                  :object_type => object.class.name,
                                  :object_local_id => object.id,
                                  :state => "new" )
      queue_item.save
    end
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;
	}
841210
def sreenqueue(item_id, item_s, *args, **kwargs):
    '''
    '''
    return vsreenqueue(item_id, item_s, args, **kwargs)
306828
public boolean execute(Canvas target, Menu menu, MenuItem item) {
		if (editController.getEditMode() == EditMode.DRAG_MODE) {
			return false;
		}
		return true;
	}
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 );
			}
		}
1207073
function processQueue(){
      try {
        // mark queue as processing to avoid concurrency
        processing = true;

        // process queue
        var item;
        while (item = queue.shift())
          item.fn.call(item.context);
      } finally {
        // queue is not processing anymore
        processing = false;

        // if any function in queue than exception was occured,
        // run rest functions in next code frame
        if (queue.length)
          timer = setImmediate(process);
      }
    }
468370
public function queue($item_id = null, $action = null)
    {

        if( is_null($item_id) ) {
            throw new NoItemException("No item id was sent");
        } else if ( ! is_numeric($item_id) ){
            throw new InvalidItemTypeException("The item id: $item_id is not valid it should be a number");
        }

        $this->actions[] =
            array(
                'action'        => $action,
                'item_id'       => $item_id,
                'time'          => time()
            );

        return true;

    }
429412
def push(self, item, priority=None):
        
        priority = item if priority is None else priority
        node = PriorityQueueNode(item, priority)
        for index, current in enumerate(self.priority_queue_list):
            if current.priority < node.priority:
                self.priority_queue_list.insert(index, node)
                return
        # when traversed complete queue
        self.priority_queue_list.append(node)
49552
public function executeBatch($batch, ZendQueue $queue)
    {
        foreach ($batch as $item) {
            $this->processQueueItem($item);
            $queue->deleteMessage($item);
        }
    }
1073063
public function commit(QueueItem $item)
    {
        $this->client->deleteMessage([
            'QueueUrl' => $this->url,
            'ReceiptHandle' => $item->getReceipt(),
        ]);
    }
840139
function (data) {
            if (this._changeEventQueue) {
                this._changeEventQueue = _.union(this._changeEventQueue, data.ids);
            } else {
                this.trigger(PREFERENCE_CHANGE, data);
            }
        }
8925
private void fireOnDeclareQueue(ChannelEvent e) {
        List<EventListener> listeners = changes.getListenerList(AMQP);
        for (EventListener listener : listeners) {
            ChannelListener amqpListener = (ChannelListener)listener;
            amqpListener.onDeclareQueue(e);
        }
    }
576459
function() {

						var self = this, item;

						self.inWork = true;
						
						if (!self.queue.length) {
							return;
						}
						
						item = self.queue.shift();

						if (item.type == 'wait') {
							setTimeout(function(){
								self._process();
							}, item.duration*1000);
						} else {
							self.context = item.func.apply(self.context, item.args);
							self._process();
						}
						return self;
					}