1 | <?php |
||
18 | class PredisPullCommandQueue implements PullCommandQueue |
||
19 | { |
||
20 | const DEFAULT_FORMAT = 'predis'; |
||
21 | |||
22 | /** |
||
23 | * @var Client |
||
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 | * @var string |
||
44 | */ |
||
45 | private $format = ''; |
||
46 | |||
47 | /** |
||
48 | * @param Client $client |
||
49 | * @param SerializerInterface $serializer |
||
50 | * @param LoggerInterface $logger |
||
51 | * @param string $queue_name |
||
52 | * @param string|null $format |
||
53 | */ |
||
54 | 6 | public function __construct( |
|
67 | |||
68 | /** |
||
69 | * Publish command to queue. |
||
70 | * |
||
71 | * @param Command $command |
||
72 | * |
||
73 | * @return bool |
||
74 | */ |
||
75 | 2 | public function publish(Command $command) |
|
81 | |||
82 | /** |
||
83 | * Pop command from queue. Return NULL if queue is empty. |
||
84 | * |
||
85 | * @return Command|null |
||
86 | */ |
||
87 | 4 | public function pull() |
|
108 | } |
||
109 |