Phive\Queue\InMemoryQueue::pop PHP Method

pop() public method

public pop ( )
    public function pop()
    {
        if (!$this->queue->isEmpty()) {
            $this->queue->setExtractFlags(\SplPriorityQueue::EXTR_PRIORITY);
            $priority = $this->queue->top();
            if (time() + $priority[0] >= 0) {
                $this->queue->setExtractFlags(\SplPriorityQueue::EXTR_DATA);
                return $this->queue->extract();
            }
        }
        throw new NoItemAvailableException($this);
    }