You are here

public function MemoryQueue::releaseItem in Purge 8.3

Releases an item that the worker could not process.

Another worker can come in and process it before the timeout expires.

Parameters

$item: The item returned by \Drupal\Core\Queue\QueueInterface::claimItem().

Return value

bool TRUE if the item has been released, FALSE otherwise.

Overrides QueueInterface::releaseItem

1 call to MemoryQueue::releaseItem()
MemoryQueue::releaseItemMultiple in src/Plugin/Purge/Queue/MemoryQueue.php
Release multiple items that the worker could not process.

File

src/Plugin/Purge/Queue/MemoryQueue.php, line 145

Class

MemoryQueue
A QueueInterface compliant volatile memory buffer queue.

Namespace

Drupal\purge\Plugin\Purge\Queue

Code

public function releaseItem($item) {
  $this
    ->bufferInitialize();
  if (!isset($this->buffer[$item->item_id])) {
    return FALSE;
  }
  $this->buffer[$item->item_id][self::EXPIRE] = 0;
  if ($item->data !== $this->buffer[$item->item_id][self::DATA]) {
    $this->buffer[$item->item_id][self::DATA] = serialize($item->data);
  }
  return TRUE;
}