| 1 | <?php |
||
| 16 | class MemoryPullCommandQueue implements PullCommandQueue |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var Command[] |
||
| 20 | */ |
||
| 21 | private $commands = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Publish command to queue. |
||
| 25 | * |
||
| 26 | * @param Command $command |
||
| 27 | * |
||
| 28 | * @return bool |
||
| 29 | */ |
||
| 30 | 1 | public function publish(Command $command): bool |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Pop command from queue. Return NULL if queue is empty. |
||
| 39 | * |
||
| 40 | * @return Command|null |
||
| 41 | */ |
||
| 42 | 1 | public function pull(): ?Command |
|
| 46 | } |
||
| 47 |