function submitTaskTo(string $workerID, \CharlotteDunois\Phoebe\AsyncTask $task) {
        if(!$task->id) {
            throw new \InvalidArgumentException('Async Task has no ID - did you call parent::__construct() in your constructor?');
        }
        
        $worker = $this->submitTo($workerID, $task);
        
        $itask = new \CharlotteDunois\Phoebe\InternalTask($worker, $task);
        $this->tasks->set($task->id, $itask);
        
        return $itask->getDeferred()->promise();
    }
function submitTaskTo(string $workerID, \CharlotteDunois\Phoebe\AsyncTask $task) {
        if(!$task->id) {
            throw new \InvalidArgumentException('Async Task has no ID - did you call parent::__construct() in your constructor?');
        }
        
        $worker = $this->submitTo($workerID, $task);
        
        $itask = new \CharlotteDunois\Phoebe\InternalTask($worker, $task);
        $this->tasks->set($task->id, $itask);
        
        return $itask->getDeferred()->promise();
    }
function submitTaskTo ( string $ workerID , \ CharlotteDunois \ Phoebe \ AsyncTask $ task ) { if ( ! $ task -> id ) { throw new \ InvalidArgumentException ( 'Async Task has no ID - did you call parent::__construct() in your constructor?' ) ; } $ worker = $ this -> submitTo ( $ workerID , $ task ) ; $ itask = new \ CharlotteDunois \ Phoebe \ InternalTask ( $ worker , $ task ) ; $ this -> tasks -> set ( $ task -> id , $ itask ) ; return $ itask -> getDeferred ( ) -> promise ( ) ; }
Submits the task to a specific worker and returns a promise which resolves or rejects with the resolve value of the task.
@param string                             $workerID
@param \CharlotteDunois\Phoebe\AsyncTask  $task
@return \React\Promise\ExtendedPromiseInterface
@throws \InvalidArgumentException
Submits the task to a specific worker and returns a promise which resolves or rejects with the resolve value of the task .