public function BatchMemory::claimItem

public BatchMemory::claimItem($lease_time = 0)

Overrides \Drupal\Core\Queue\Memory::claimItem().

Unlike \Drupal\Core\Queue\Memory::claimItem(), this method provides a default lease time of 0 (no expiration) instead of 30. This allows the item to be claimed repeatedly until it is deleted.

Overrides Memory::claimItem

File

core/lib/Drupal/Core/Queue/BatchMemory.php, line 25

Class

BatchMemory
Defines a batch queue handler used by the Batch API for non-progressive batches.

Namespace

Drupal\Core\Queue

Code

public function claimItem($lease_time = 0) {
  if (!empty($this->queue)) {
    reset($this->queue);
    return current($this->queue);
  }
  return FALSE;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Queue!BatchMemory.php/function/BatchMemory::claimItem/8.1.x