1 | <?php |
||
15 | class ExecutingSubscribeCommandQueue implements SubscribeCommandQueue |
||
16 | { |
||
17 | /** |
||
18 | * @var callable[] |
||
19 | */ |
||
20 | private $handlers = []; |
||
21 | |||
22 | /** |
||
23 | * Publish command to queue. |
||
24 | * |
||
25 | * @param Command $command |
||
26 | * |
||
27 | * @return bool |
||
28 | */ |
||
29 | 1 | public function publish(Command $command) |
|
38 | |||
39 | /** |
||
40 | * Subscribe on command queue. |
||
41 | * |
||
42 | * @param callable $handler |
||
43 | */ |
||
44 | 1 | public function subscribe(callable $handler) |
|
48 | |||
49 | /** |
||
50 | * Unsubscribe on command queue. |
||
51 | * |
||
52 | * @param callable $handler |
||
53 | * |
||
54 | * @return bool |
||
55 | */ |
||
56 | 1 | public function unsubscribe(callable $handler) |
|
68 | } |
||
69 |