You are here

public function DelayableQueueInterface::delayItem in Drupal 9

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Queue/DelayableQueueInterface.php \Drupal\Core\Queue\DelayableQueueInterface::delayItem()

Delay an item so it runs in the future.

Parameters

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

int $delay: A delay before the item's lock should expire (in seconds). Relative to the current time, not the item's current expiry.

Return value

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

Throws

\InvalidArgumentException When a negative $delay is provided; $delay must be non-negative.

To immediately release an item without delay.

See also

\Drupal\Core\Queue\QueueInterface::releaseItem()

1 method overrides DelayableQueueInterface::delayItem()
DatabaseQueue::delayItem in core/lib/Drupal/Core/Queue/DatabaseQueue.php
Delay an item so it runs in the future.

File

core/lib/Drupal/Core/Queue/DelayableQueueInterface.php, line 32

Class

DelayableQueueInterface
Delayable queue interface.

Namespace

Drupal\Core\Queue

Code

public function delayItem($item, int $delay);