You are here

public function Manager::processQueue in Taxonomy Term Depth 8.2

1 call to Manager::processQueue()
Manager::queueByIds in src/QueueManager/Manager.php

File

src/QueueManager/Manager.php, line 122

Class

Manager

Namespace

Drupal\taxonomy_term_depth\QueueManager

Code

public function processQueue() {
  $queue_worker = \Drupal::service('plugin.manager.queue_worker')
    ->createInstance('taxonomy_term_depth_update_depth');
  while ($item = $this->queue
    ->claimItem()) {
    try {
      $queue_worker
        ->processItem($item->data);
      $this->queue
        ->deleteItem($item);
    } catch (SuspendQueueException $e) {
      $this->queue
        ->releaseItem($item);
      break;
    } catch (\Exception $e) {
      watchdog_exception('npq', $e);
    }
  }
}