예제 #1
0
 public function testFlowException()
 {
     $queue = new LocalArrayTestQueue();
     $messageTransformer = new TaskMessageSerializeTransformer();
     $taskFactory = new TaskFactorySimple();
     $taskRunnerSupervisor = new TaskRunnerNullSupervisor();
     $taskScheduler = new TaskScheduler($queue, $messageTransformer, $messageTransformer);
     $taskRunner = new TaskRunner($queue, $messageTransformer, $taskFactory, $messageTransformer, $taskRunnerSupervisor);
     $input = [];
     $taskInput = new TaskInput($input);
     $futureTaskResult = $taskScheduler->submit('testType', TestTask::class, $taskInput);
     $taskRunner->runOnce('testType');
     $this->setExpectedException(\Exception::class);
     $futureTaskResult->getTaskResult()->getResult();
 }
예제 #2
0
 /**
  * @param string $type
  */
 public function work($type)
 {
     $this->taskRunner->run($type);
 }