class QueueData in Warmer 8
Same name and namespace in other branches
- 2.x src/QueueData.php \Drupal\warmer\QueueData
Value object to store in the queue with all the infor to process a batch.
Hierarchy
- class \Drupal\warmer\QueueData
Expanded class hierarchy of QueueData
2 files declare their use of QueueData
- ItemWarmer.php in src/
Plugin/ QueueWorker/ ItemWarmer.php - ItemWarmerTest.php in tests/
src/ Unit/ Plugin/ QueueWorker/ ItemWarmerTest.php
File
- src/
QueueData.php, line 8
Namespace
Drupal\warmerView source
class QueueData {
/**
* The callback to call on dequeue.
*
* @var callable
*/
private $callback;
/**
* The item IDs to process.
*
* @var array
*/
private $ids;
/**
* The warmer ID.
*
* @var string
*/
private $warmerId;
/**
* Creates a queue data object.
*
* @param callable $callback
* The callback to call on dequeue.
* @param array $ids
* The item IDs to process.
* @param $warmer_id
* The warmer ID.
*/
public function __construct(callable $callback, array $ids, $warmer_id) {
$this->callback = $callback;
$this->ids = $ids;
$this->warmerId = $warmer_id;
}
/**
* Function to execute after claiming the item.
*/
public function process() {
call_user_func($this->callback, $this->ids, $this->warmerId);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
QueueData:: |
private | property | The callback to call on dequeue. | |
QueueData:: |
private | property | The item IDs to process. | |
QueueData:: |
private | property | The warmer ID. | |
QueueData:: |
public | function | Function to execute after claiming the item. | |
QueueData:: |
public | function | Creates a queue data object. |