submitTask() публичный Метод

public submitTask ( AsyncTask $task )
$task AsyncTask
Пример #1
0
 /**
  * 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);
 }
Пример #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);
 }