1 | <?php |
||
18 | class PredisCommandQueue implements CommandQueue |
||
19 | { |
||
20 | const 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 | * @param Client $client |
||
44 | * @param SerializerInterface $serializer |
||
45 | * @param LoggerInterface $logger |
||
46 | * @param string $queue_name |
||
47 | */ |
||
48 | 3 | public function __construct(Client $client, SerializerInterface $serializer, LoggerInterface $logger, $queue_name) |
|
55 | |||
56 | /** |
||
57 | * Push command to queue. |
||
58 | * |
||
59 | * @param Command $command |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | 1 | public function push(Command $command) |
|
69 | |||
70 | /** |
||
71 | * Pop command from queue. Return NULL if queue is empty. |
||
72 | * |
||
73 | * @return Command|null |
||
74 | */ |
||
75 | 2 | public function pull() |
|
96 | } |
||
97 |