abstract class AcquiaPurgeProcessorBase in Acquia Purge 7
Base class for processors that process items from the queue.
Hierarchy
- class \AcquiaPurgeProcessorBase implements AcquiaPurgeProcessorInterface
Expanded class hierarchy of AcquiaPurgeProcessorBase
File
- lib/
processor/ AcquiaPurgeProcessorBase.php, line 11 - Contains AcquiaPurgeProcessorBase.
View source
abstract class AcquiaPurgeProcessorBase implements AcquiaPurgeProcessorInterface {
/**
* The Acquia Purge service object.
*
* @var AcquiaPurgeService
*/
protected $service;
/**
* Construct a new AcquiaPurgeProcessorBase instance.
*
* @param AcquiaPurgeService $service
* The Acquia Purge service object.
*/
public function __construct(AcquiaPurgeService $service) {
$this->service = $service;
}
/**
* Attempt to process a chunk from the queue.
*
* @param bool $log
* (optional) Whether diagnostic failure should be logged or not.
*/
protected function processQueueChunk($log = TRUE) {
// Test if the diagnostic tests prohibit purging the queue.
if ($err = $this->service
->diagnostics()
->isSystemBlocked()) {
if ($log) {
$this->service
->diagnostics()
->log($err);
}
return;
}
// Acquire a lock and process a chunk from the queue.
if ($this->service
->lockAcquire()) {
$this->service
->process();
$this->service
->lockRelease();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AcquiaPurgeProcessorBase:: |
protected | property | The Acquia Purge service object. | |
AcquiaPurgeProcessorBase:: |
protected | function | Attempt to process a chunk from the queue. | 1 |
AcquiaPurgeProcessorBase:: |
public | function | Construct a new AcquiaPurgeProcessorBase instance. | 2 |
AcquiaPurgeProcessorInterface:: |
public | function | Subscribe to the events this processor requires. | 3 |
AcquiaPurgeProcessorInterface:: |
public static | function | Determine if the processor is enabled or not. | 3 |