submitTask() public method

public submitTask ( AsyncTask $task )
$task AsyncTask
 /**
  * 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);
 }
Example #2
0
 /**
  * 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);
 }