1 | <?php |
||
14 | final class FilesystemQueue implements QueueInterface, \Countable |
||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $directory; |
||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | private $mode; |
||
24 | |||
25 | /** |
||
26 | * FileStorage constructor. |
||
27 | * @param string $directory |
||
28 | * @param int $mode |
||
29 | */ |
||
30 | 3 | public function __construct(string $directory, int $mode = 0750) |
|
35 | |||
36 | |||
37 | /** |
||
38 | * @param MessageInterface $message |
||
39 | */ |
||
40 | 3 | public function store(MessageInterface $message): void |
|
52 | |||
53 | /** |
||
54 | * @return MessageInterface |
||
55 | * @throws EmptyQueueException |
||
56 | */ |
||
57 | 2 | public function fetch(): MessageInterface |
|
69 | |||
70 | /** |
||
71 | * @return int |
||
72 | */ |
||
73 | public function count(): int |
||
77 | } |