1 | <?php |
||
16 | class ExecutingSubscribeCommandQueue implements SubscribeCommandQueue |
||
17 | { |
||
18 | /** |
||
19 | * @var callable[] |
||
20 | */ |
||
21 | private $handlers = []; |
||
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 |
|
39 | |||
40 | /** |
||
41 | * Subscribe on command queue. |
||
42 | * |
||
43 | * @param callable $handler |
||
44 | */ |
||
45 | 1 | public function subscribe(callable $handler): void |
|
49 | |||
50 | /** |
||
51 | * Unsubscribe on command queue. |
||
52 | * |
||
53 | * @param callable $handler |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | 1 | public function unsubscribe(callable $handler): bool |
|
69 | } |
||
70 |