1 | <?php |
||
13 | final class RedisQueue implements QueueInterface, \Countable |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var ClientInterface |
||
18 | */ |
||
19 | private $client; |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $key; |
||
24 | |||
25 | /** |
||
26 | * RedisQueue constructor. |
||
27 | * @param ClientInterface $client |
||
28 | * @param string $key |
||
29 | */ |
||
30 | 4 | public function __construct(ClientInterface $client, string $key) |
|
35 | |||
36 | /** |
||
37 | * @param MessageInterface $message |
||
38 | * @throws QueueStoreException |
||
39 | */ |
||
40 | 3 | public function store(MessageInterface $message): void |
|
48 | |||
49 | /** |
||
50 | * @return MessageInterface |
||
51 | * @throws EmptyQueueException |
||
52 | * @throws QueueStoreException |
||
53 | */ |
||
54 | 2 | public function fetch(): MessageInterface |
|
67 | |||
68 | |||
69 | /** |
||
70 | * @return int |
||
71 | * @throws QueueStoreException |
||
72 | */ |
||
73 | 1 | public function count(): int |
|
81 | } |