setAllowParallelRuns(false); } /** * @param array{taskId: int} $argument * @inheritDoc */ protected function run($argument) { $taskId = $argument['taskId']; $task = $this->textProcessingManager->getTask($taskId); try { $this->textProcessingManager->runTask($task); $event = new TaskSuccessfulEvent($task); } catch (\Throwable $e) { $event = new TaskFailedEvent($task, $e->getMessage()); } $this->eventDispatcher->dispatchTyped($event); } }