| 1 | <?php namespace Indatus\Dispatcher; |
||
| 12 | class Queue |
||
| 13 | { |
||
| 14 | /** @var QueueItem[] */ |
||
| 15 | protected $queue = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Add an item to the queue |
||
| 19 | * @param QueueItem $item |
||
| 20 | */ |
||
| 21 | 2 | public function add(QueueItem $item) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * The size of the queue |
||
| 30 | * @return int |
||
| 31 | */ |
||
| 32 | 1 | public function size() |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Get all items in the queue |
||
| 39 | * @return QueueItem[] |
||
| 40 | */ |
||
| 41 | 1 | public function flush() |
|
| 48 | } |
||
| 49 |