/** * @test */ public function waitAndExecuteGetsAndExecutesJobFromQueue() { $job = new TestJob(); $this->jobManager->queue('TestQueue', $job); /** @var TestJob $queuedJob */ $queuedJob = $this->jobManager->waitAndExecute('TestQueue'); $this->assertTrue($queuedJob->getProcessed()); }
/** * @param JoinPointInterface $joinPoint The current join point * @return mixed * @Flow\Around("methodAnnotatedWith(TYPO3\Jobqueue\Common\Annotations\Defer)") */ public function queueMethodCallAsJob(JoinPointInterface $joinPoint) { if ($this->processingJob) { return $joinPoint->getAdviceChain()->proceed($joinPoint); } $deferAnnotation = $this->reflectionService->getMethodAnnotation($joinPoint->getClassName(), $joinPoint->getMethodName(), 'TYPO3\\Jobqueue\\Common\\Annotations\\Defer'); $queueName = $deferAnnotation->queueName; $job = new StaticMethodCallJob($joinPoint->getClassName(), $joinPoint->getMethodName(), $joinPoint->getMethodArguments()); $this->jobManager->queue($queueName, $job); return NULL; }
/** */ protected function triggerSolrUpdate() { $job = new SolrUpdateJob('solr'); $this->jobManager->queue('solr', $job); }