You are here

public function ContentHubImportQueueByFilter::batchProcess in Acquia Content Hub 8.2

Process the batch.

Throws

\Drupal\Component\Plugin\Exception\PluginException

File

modules/acquia_contenthub_subscriber/src/ContentHubImportQueueByFilter.php, line 75

Class

ContentHubImportQueueByFilter
Implements an Import Queue for entites based on custom filters.

Namespace

Drupal\acquia_contenthub_subscriber

Code

public function batchProcess() {
  $filter_queue_worker = $this->queueWorkerManager
    ->createInstance('acquia_contenthub_import_from_filters');
  if ($item = $this->filterQueue
    ->claimItem()) {
    try {
      $filter_queue_worker
        ->processItem($item->data);
      $this->filterQueue
        ->deleteItem($item);
    } catch (SuspendQueueException $exception) {
      $context['errors'][] = $exception
        ->getMessage();
      $context['success'] = FALSE;
      $this->filterQueue
        ->releaseItem($item);
    }
  }
}