Service/GearmanClient.php
public function runTasks()
    {
        $gearmanClient = $this->getNativeClient();
        $this->assignServers($gearmanClient);

        if ($this->settings['callbacks']) {

            $this->gearmanCallbacksDispatcher->assignTaskCallbacks($gearmanClient);
        }

        foreach ($this->taskStructure as $task) {

            $type = $task['method'];
            $jobName = $task['name'];
            $worker = $this->getJob($jobName);

            if (false !== $worker) {

                $gearmanClient->$type(
                    $worker['job']['realCallableName'],
                    $task['params'],
                    $task['context'],
                    $task['unique']
                );
            }
        }

        $this->initTaskStructure();

        $this->gearmanClient = null;

        return $gearmanClient->runTasks();
    }
public function runTasks()
    {
        $gearmanClient = $this->getNativeClient();
        $this->assignServers($gearmanClient);

        if ($this->settings['callbacks']) {

            $this->gearmanCallbacksDispatcher->assignTaskCallbacks($gearmanClient);
        }

        foreach ($this->taskStructure as $task) {

            $type = $task['method'];
            $jobName = $task['name'];
            $worker = $this->getJob($jobName);

            if (false !== $worker) {

                $gearmanClient->$type(
                    $worker['job']['realCallableName'],
                    $task['params'],
                    $task['context'],
                    $task['unique']
                );
            }
        }

        $this->initTaskStructure();

        $this->gearmanClient = null;

        return $gearmanClient->runTasks();
    }
public function runTasks ( ) { $ gearmanClient = $ this -> getNativeClient ( ) ; $ this -> assignServers ( $ gearmanClient ) ; if ( $ this -> settings [ 'callbacks' ] ) { $ this -> gearmanCallbacksDispatcher -> assignTaskCallbacks ( $ gearmanClient ) ; } foreach ( $ this -> taskStructure as $ task ) { $ type = $ task [ 'method' ] ; $ jobName = $ task [ 'name' ] ; $ worker = $ this -> getJob ( $ jobName ) ; if ( false !== $ worker ) { $ gearmanClient -> $ type ( $ worker [ 'job' ] [ 'realCallableName' ] , $ task [ 'params' ] , $ task [ 'context' ] , $ task [ 'unique' ] ) ; } } $ this -> initTaskStructure ( ) ; $ this -> gearmanClient = null ; return $ gearmanClient -> runTasks ( ) ; }
For a set of tasks previously added with

GearmanClient::addTask(),
GearmanClient::addTaskHigh(),
GearmanClient::addTaskLow(),
GearmanClient::addTaskBackground(),
GearmanClient::addTaskHighBackground(),
GearmanClient::addTaskLowBackground(),

this call starts running the tasks in parallel.
Note that enough workers need to be available for the tasks to all run in parallel

@return boolean run tasks result
For a set of tasks previously added with