1 | <?php |
||
18 | class PredisPullCommandQueue implements PullCommandQueue |
||
19 | { |
||
20 | /** |
||
21 | * @var Client |
||
22 | */ |
||
23 | private $client; |
||
24 | |||
25 | /** |
||
26 | * @var Serializer |
||
27 | */ |
||
28 | private $serializer; |
||
29 | |||
30 | /** |
||
31 | * @var LoggerInterface |
||
32 | */ |
||
33 | private $logger; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $queue_name = ''; |
||
39 | |||
40 | /** |
||
41 | * @param Client $client |
||
42 | * @param Serializer $serializer |
||
43 | * @param LoggerInterface $logger |
||
44 | * @param string $queue_name |
||
45 | */ |
||
46 | public function __construct(Client $client, Serializer $serializer, LoggerInterface $logger, $queue_name) |
||
53 | |||
54 | /** |
||
55 | * Publish command to queue. |
||
56 | * |
||
57 | * @param Command $command |
||
58 | * |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function publish(Command $command) |
||
67 | |||
68 | /** |
||
69 | * Pop command from queue. Return NULL if queue is empty. |
||
70 | * |
||
71 | * @return Command|null |
||
72 | */ |
||
73 | public function pull() |
||
94 | } |
||
95 |