You are here

public function QueueManager::enqueueBatch in Warmer 8

Same name and namespace in other branches
  1. 2.x src/QueueManager.php \Drupal\warmer\QueueManager::enqueueBatch()

Add a batch of warming operations to the queue.

Parameters

callable $callback: The operation to call when dequeuing.

array $ids: The list of IDs.

\Drupal\warmer\Plugin\WarmerPluginBase $warmer: The warmer plugin.

File

src/QueueManager.php, line 45

Class

QueueManager
Manage queue items and processing.

Namespace

Drupal\warmer

Code

public function enqueueBatch(callable $callback, array $ids, WarmerPluginBase $warmer) {
  $this->queue
    ->createItem(new QueueData($callback, $ids, $warmer
    ->getPluginId()));
  $warmer
    ->markAsEnqueued();
}