1 | <?php |
||
5 | class BusQue |
||
6 | { |
||
7 | |||
8 | private $implementation; |
||
9 | |||
10 | 16 | public function __construct(Implementation $implementation) |
|
14 | |||
15 | 1 | public function getQueueName($command): string |
|
19 | |||
20 | 1 | public function serializeCommand($command): string |
|
24 | |||
25 | 2 | public function unserializeCommand(string $serialized) |
|
29 | |||
30 | 1 | public function generateCommandId($command): string |
|
34 | |||
35 | 1 | public function queueCommand($command, string $commandId = null) |
|
39 | |||
40 | 1 | public function scheduleCommand($command, \DateTime $dateTime, string $commandId = null) |
|
44 | |||
45 | 1 | public function isIdQueued(string $queueName, string $id): bool |
|
46 | { |
||
47 | 1 | return $this->implementation->getQueueDriver()->isIdQueued($queueName, $id); |
|
48 | } |
||
49 | |||
50 | 1 | public function getQueuedCount(string $queueName): int |
|
54 | |||
55 | 1 | public function purgeCommand(string $queueName, string $commandId) |
|
59 | |||
60 | 1 | public function deleteQueue(string $queueName) |
|
61 | { |
||
62 | 1 | $this->implementation->getQueueDriver()->deleteQueue($queueName); |
|
63 | 1 | } |
|
64 | |||
65 | 1 | public function listQueues(): array |
|
69 | |||
70 | 1 | public function listQueuedIds(string $queueName, int $offset = 0, int $limit = 10): array |
|
74 | |||
75 | 1 | public function isIdInProgress(string $queueName, string $id): bool |
|
76 | { |
||
77 | 1 | return $this->implementation->getQueueDriver()->isIdConsuming($queueName, $id); |
|
78 | } |
||
79 | |||
80 | 1 | public function listInProgressIds(string $queueName): array |
|
81 | { |
||
82 | 1 | return $this->implementation->getQueueDriver()->getConsumingIds($queueName); |
|
83 | } |
||
84 | |||
85 | 1 | public function getCommand(string $queueName, string $id) |
|
90 | |||
91 | public function workQueue(string $queueName, int $n = null, int $time = null) |
||
95 | |||
96 | public function workSchedule(int $n = null, int $time = null) |
||
100 | } |
||
101 |