public function executeOutstandingJobs()
 {
     $queues = $this->queueRegistry->all();
     foreach ($queues as $queue) {
         $this->processQueueJobs($queue);
     }
 }
Ejemplo n.º 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output = new SymfonyStyle($input, $output);
     $queues = $this->queueRegistry->all();
     $tableInput = array();
     foreach ($queues as $queue) {
         $tableInput[] = array($queue->getName(), $queue->count());
     }
     $output->table(array('Name', 'Outstanding jobs'), $tableInput);
 }
Ejemplo n.º 3
0
 public function testAllReturnsRegisteredQueues()
 {
     return $this->markTestIncomplete();
     $queues = $this->registry->all();
     $this->assertCount(0, $queues);
     $foo = $this->registry->createQueue('foo');
     $this->registry->register($foo);
     $queues = $this->registry->all();
     $this->assertCount(1, $queues);
     $this->assertEquals('foo', $queues['foo']);
     $bar = $this->registry->createQueue('bar');
     $this->registry->register($bar);
     $queues = $this->registry->all();
     $this->assertCount(2, $queues);
     $this->assertNotContains($foo, $queues);
     $this->assertNotContains($bar, $queues);
 }
Ejemplo n.º 4
0
 function it_dequeues_jobs_from_all_queues(QueueRegistryInterface $registry, QueueInterface $queueBaz, QueueInterface $queueFoo, JobInterface $jobBaz, JobInterface $jobFoo)
 {
     $registry->all()->willReturn([$queueBaz, $queueFoo]);
     $queueBaz->dequeue()->shouldBeCalled(1)->willReturn($jobBaz);
     $this->dequeue()->shouldReturn($jobBaz);
     $queueBaz->dequeue()->shouldBeCalled(1)->willReturn(null);
     $queueFoo->dequeue()->shouldBeCalled(1)->willReturn($jobFoo);
     $this->dequeue()->shouldReturn($jobFoo);
     $queueBaz->dequeue()->shouldBeCalled(1)->willReturn(null);
     $queueFoo->dequeue()->shouldBeCalled(1)->willReturn(null);
     $this->dequeue()->shouldReturn(null);
 }