1 | <?php |
||
11 | class Consumer extends AbstractClient { |
||
12 | |||
13 | /** |
||
14 | * @param string|string[] $queues |
||
15 | * @param int $count |
||
16 | * @param int $timeoutMs |
||
17 | * @return Job[] |
||
18 | */ |
||
19 | 7 | public function getJobs($queues, $count = 1, $timeoutMs = 200) |
|
33 | |||
34 | |||
35 | /** |
||
36 | * Retrieve a single job from the given queues |
||
37 | * |
||
38 | * @param string|string[] $queues |
||
39 | * @param int $timeoutMs How long to block client when waiting for new jobs. |
||
40 | * @return Job|null A Job if found, null otherwise. |
||
41 | */ |
||
42 | 7 | public function getJob($queues, $timeoutMs = 200) { |
|
51 | |||
52 | |||
53 | /** |
||
54 | * Acknowledge a job execution. |
||
55 | * |
||
56 | * @param Job $job |
||
57 | * |
||
58 | * @return int Number of Jobs acknowledged. |
||
59 | */ |
||
60 | 4 | public function ack(Job $job) |
|
65 | |||
66 | |||
67 | /** |
||
68 | * Fast Acknowledge a job execution. |
||
69 | * |
||
70 | * @param Job $job |
||
71 | * |
||
72 | * @return int Number of Jobs acknowledged. |
||
73 | * @see https://github.com/antirez/disque#fast-acknowledges |
||
74 | */ |
||
75 | 1 | public function fastAck(Job $job) |
|
80 | |||
81 | |||
82 | /** |
||
83 | * Return the job with the given jobId. |
||
84 | * |
||
85 | * @param string $jobId |
||
86 | * |
||
87 | * @return Job|null |
||
88 | * @throws CommandException |
||
89 | */ |
||
90 | 2 | public function show($jobId) |
|
100 | |||
101 | |||
102 | /** |
||
103 | * NACK the given job ids. |
||
104 | * |
||
105 | * @param string[] $jobIds |
||
106 | * @return int Number of NACK'd jobs |
||
107 | */ |
||
108 | 1 | public function nack(array $jobIds) |
|
112 | |||
113 | |||
114 | /** |
||
115 | * Send a notice to the server that this client is still processing the job. |
||
116 | * |
||
117 | * @param Job $job |
||
118 | * |
||
119 | * @return int The current retry time for the job |
||
120 | * |
||
121 | * @see https://github.com/antirez/disque#working-jobid |
||
122 | */ |
||
123 | 1 | public function working(Job $job) |
|
127 | } |
||
128 |