You are here

public function AcquiaPurgeService::queue in Acquia Purge 7

Retrieve the loaded queue backend object.

Return value

AcquiaPurgeQueueInterface The queue backend.

File

lib/AcquiaPurgeService.php, line 521
Contains AcquiaPurgeService.

Class

AcquiaPurgeService
The Acquia Purge service.

Code

public function queue() {
  if (is_null($this->queue)) {

    // Assure that all dependent code is loaded, lets not rely on registry.
    $state = $this
      ->state();

    // Load the configured smart or normal backend.
    _acquia_purge_load('_acquia_purge_queue_interface');
    if (_acquia_purge_variable('acquia_purge_smartqueue')) {
      $class = _acquia_purge_load('_acquia_purge_queue_smart');
      $this->queue = new $class($state);
    }
    else {
      $class = _acquia_purge_load('_acquia_purge_queue_efficient');
      $this->queue = new $class($state);
    }
  }
  return $this->queue;
}