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

public submitTaskToWorker ( AsyncTask $task, $worker )
$task AsyncTask
Пример #1
0
 /**
  * Submits an asynchronous task to a specific Worker in the Pool
  *
  * @param AsyncTask $task
  * @param int       $worker
  *
  * @return void
  */
 public function scheduleAsyncTaskToWorker(AsyncTask $task, $worker)
 {
     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->submitTaskToWorker($task, $worker);
 }
Пример #2
0
 /**
  * Submits an asynchronous task to a specific Worker in the Pool
  *
  * @param AsyncTask $task
  * @param int       $worker
  *
  * @return void
  */
 public function scheduleAsyncTaskToWorker(AsyncTask $task, $worker)
 {
     $id = $this->nextId();
     $task->setTaskId($id);
     $this->asyncPool->submitTaskToWorker($task, $worker);
 }