1 | <?php |
||
18 | class PredisCommandQueue implements CommandQueue |
||
19 | { |
||
20 | const LIST_KEY = 'commands'; |
||
21 | const FORMAT = 'predis'; |
||
22 | |||
23 | /** |
||
24 | * @var Client |
||
25 | */ |
||
26 | private $client; |
||
27 | |||
28 | /** |
||
29 | * @var SerializerInterface |
||
30 | */ |
||
31 | private $serializer; |
||
32 | |||
33 | /** |
||
34 | * @var LoggerInterface |
||
35 | */ |
||
36 | private $logger; |
||
37 | |||
38 | /** |
||
39 | * @param Client $client |
||
40 | * @param SerializerInterface $serializer |
||
41 | * @param LoggerInterface $logger |
||
42 | */ |
||
43 | 3 | public function __construct(Client $client, SerializerInterface $serializer, LoggerInterface $logger) |
|
49 | |||
50 | /** |
||
51 | * Push command to queue. |
||
52 | * |
||
53 | * @param Command $command |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | 1 | public function push(Command $command) |
|
63 | |||
64 | /** |
||
65 | * Pop command from queue. Return NULL if queue is empty. |
||
66 | * |
||
67 | * @return Command|null |
||
68 | */ |
||
69 | 2 | public function pop() |
|
90 | } |
||
91 |