. */ namespace SP\Modules\Web\Controllers\Task; use SP\Domain\Task\Services\TaskFactory; use SP\Infrastructure\File\FileException; /** * Class TestTaskController */ final class TestTaskController { /** * @param string $taskId * * @throws FileException */ public function testTaskAction(string $taskId): void { $task = TaskFactory::register($taskId, $taskId); echo $task->getTaskId(); $count = 0; while ($count < 60) { TaskFactory::update($task, TaskFactory::createMessage($task->getTaskId(), "Test Task $count")); sleep(1); $count++; } TaskFactory::end($task); } }