1 | <?php |
||
18 | class PredisUniqueCommandQueue implements CommandQueue |
||
19 | { |
||
20 | const LIST_KEY = 'unique_commands'; |
||
21 | const FORMAT = PredisCommandQueue::FORMAT; |
||
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) |
|
66 | |||
67 | /** |
||
68 | * Pop command from queue. Return NULL if queue is empty. |
||
69 | * |
||
70 | * @return Command|null |
||
71 | */ |
||
72 | 2 | public function pop() |
|
93 | } |
||
94 |