/** * Submits an asynchronous task to the Worker Pool * * @param AsyncTask $task * * @return void */ public function scheduleAsyncTask(AsyncTask $task) { if ($task->getTaskId() !== null) { throw new \UnexpectedValueException("Attempt to schedule the same AsyncTask instance twice"); } $id = $this->nextId(); $task->setTaskId($id); $task->progressUpdates = new \Threaded(); $this->asyncPool->submitTask($task); }
/** * Submits an asynchronous task to the Worker Pool * * @param AsyncTask $task * * @return void */ public function scheduleAsyncTask(AsyncTask $task) { $id = $this->nextId(); $task->setTaskId($id); $this->asyncPool->submitTask($task); }