1 | <?php |
||
18 | class PredisCommandQueue implements CommandQueue |
||
19 | { |
||
20 | const FORMAT = 'predis'; |
||
21 | |||
22 | /** |
||
23 | * @var RedisPubSubAdapter |
||
24 | */ |
||
25 | private $client; |
||
26 | |||
27 | /** |
||
28 | * @var SerializerInterface |
||
29 | */ |
||
30 | private $serializer; |
||
31 | |||
32 | /** |
||
33 | * @var LoggerInterface |
||
34 | */ |
||
35 | private $logger; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $queue_name = ''; |
||
41 | |||
42 | /** |
||
43 | * @param RedisPubSubAdapter $client |
||
44 | * @param SerializerInterface $serializer |
||
45 | * @param LoggerInterface $logger |
||
46 | * @param string $queue_name |
||
47 | */ |
||
48 | public function __construct( |
||
59 | |||
60 | /** |
||
61 | * Publish command to queue. |
||
62 | * |
||
63 | * @param Command $command |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | public function publish(Command $command) |
||
74 | |||
75 | /** |
||
76 | * Subscribe on command queue. |
||
77 | * |
||
78 | * @param callable $handler |
||
79 | */ |
||
80 | public function subscribe(callable $handler) |
||
102 | } |
||
103 |