You are here

private static function HookImplementations::singleWarmer in Warmer 2.x

Same name and namespace in other branches
  1. 8 src/HookImplementations.php \Drupal\warmer\HookImplementations::singleWarmer()

Executes one warmer.

Parameters

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

\Drupal\warmer\QueueManager $queue_manager: The queue manager.

1 call to HookImplementations::singleWarmer()
HookImplementations::enqueueWarmers in src/HookImplementations.php
Helper function to implement hook_cron.

File

src/HookImplementations.php, line 50

Class

HookImplementations
Helper functions to use in hook implementations.

Namespace

Drupal\warmer

Code

private static function singleWarmer(WarmerPluginBase $warmer, QueueManager $queue_manager) {
  $ids = [
    NULL,
  ];
  while ($ids = $warmer
    ->buildIdsBatch(end($ids))) {
    $queue_manager
      ->enqueueBatch(static::class . '::warmBatch', $ids, $warmer);
  }
}