1 | <?php |
||
16 | class MemoryUniquePullCommandQueue 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 |
|
43 | |||
44 | /** |
||
45 | * Pop command from queue. Return NULL if queue is empty. |
||
46 | * |
||
47 | * @return Command|null |
||
48 | */ |
||
49 | 1 | public function pull(): ?Command |
|
53 | } |
||
54 |