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