/** * @param string $type * @param string $taskClass * @param array $parameters * @return FutureResult */ public function submit($type, $taskClass, $parameters) { $taskInput = new TaskInput($parameters); $futureTaskResult = $this->taskScheduler->submit($type, $taskClass, $taskInput); $futureResult = new FutureResult($futureTaskResult); return $futureResult; }
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(); }