Pool::submitTo PHP Method

submitTo() public method

Submit the task to the specific Worker in the Pool
public submitTo ( integer $worker, Threaded $task ) : integer
$worker integer The worker for execution
$task Threaded The task for execution
return integer the identifier of the Worker that accepted the object
    public function submitTo($worker, Threaded $task)
    {
    }

Usage Example

Esempio n. 1
0
 public function submitTaskToWorker(AsyncTask $task, $worker)
 {
     if ($task->isGarbage()) {
         return;
     }
     $worker = (int) $worker;
     if ($worker < 0 or $worker >= $this->size) {
         throw new \InvalidArgumentException("Invalid worker {$worker}");
     }
     $this->tasks[$task->getTaskId()] = $task;
     $this->pool->submitTo((int) $worker, $task);
 }
All Usage Examples Of Pool::submitTo