You are here

public function Rest::process in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 modules/salesforce_push/src/Plugin/SalesforcePushQueueProcessor/Rest.php \Drupal\salesforce_push\Plugin\SalesforcePushQueueProcessor\Rest::process()
  2. 5.0.x modules/salesforce_push/src/Plugin/SalesforcePushQueueProcessor/Rest.php \Drupal\salesforce_push\Plugin\SalesforcePushQueueProcessor\Rest::process()

Process push queue items.

Overrides PushQueueProcessorInterface::process

File

modules/salesforce_push/src/Plugin/SalesforcePushQueueProcessor/Rest.php, line 118

Class

Rest
Rest queue processor plugin.

Namespace

Drupal\salesforce_push\Plugin\SalesforcePushQueueProcessor

Code

public function process(array $items) {
  if (!$this->client
    ->isAuthorized()) {
    throw new SuspendQueueException('Salesforce client not authorized.');
  }
  foreach ($items as $item) {
    try {
      $this
        ->processItem($item);
      $this->queue
        ->deleteItem($item);
    } catch (\Exception $e) {
      $this->queue
        ->failItem($e, $item);
    }
  }
}