We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5687c8f commit ff0d2bcCopy full SHA for ff0d2bc
test/Resque/Tests/WorkerTest.php
@@ -247,4 +247,27 @@ public function testWorkerFailsUncompletedJobsOnExit()
247
248
$this->assertEquals(1, Resque_Stat::get('failed'));
249
}
250
+
251
+ public function testBlockingListPop()
252
+ {
253
+ $worker = new Resque_Worker('jobs');
254
+ $worker->registerWorker();
255
256
+ Resque::enqueue('jobs', 'Test_Job_1');
257
+ Resque::enqueue('jobs', 'Test_Job_2');
258
259
+ $i = 1;
260
+ while($job = $worker->reserve(60))
261
262
+ $this->assertEquals('Test_Job_' . $i, $job->payload['class']);
263
264
+ if($i == 2) {
265
+ break;
266
+ }
267
268
+ $i++;
269
270
271
+ $this->assertEquals(2, $i);
272
273
0 commit comments