function MemoryQueue::claimItem

Overrides DrupalQueueInterface::claimItem

1 method overrides MemoryQueue::claimItem()
BatchMemoryQueue::claimItem in includes/batch.queue.inc
Overrides MemoryQueue::claimItem().

File

modules/system/system.queue.inc, line 336

Class

MemoryQueue
Static queue implementation.

Code

public function claimItem($lease_time = 30) {
    foreach ($this->queue as $key => $item) {
        if ($item->expire == 0) {
            $item->expire = time() + $lease_time;
            $this->queue[$key] = $item;
            return $item;
        }
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.