public function executeOutstandingJobs() { $queues = $this->queueRegistry->all(); foreach ($queues as $queue) { $this->processQueueJobs($queue); } }
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); }
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); }
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); }