private function subExec($instances, $retryCount = 0, $retryWait = 0)
    {
        $curlMultiInstance = curl_multi_init();

        foreach ($instances as $name => $curlInstance) {
            curl_multi_add_handle($curlMultiInstance, $curlInstance->getHandle());
        }

        do {
            curl_multi_exec($curlMultiInstance, $stillRunning);
            curl_multi_select($curlMultiInstance);
        } while ($stillRunning);

        for ($retry = 1; $retry <= $retryCount; $retry++) {
            $retryRequired = false;

            foreach ($instances as $curlInstance) {
                if (!$curlInstance->isSuccessful()) {
                    $retryRequired = true;
                    break;
                }
            }

            if (!$retryRequired) {
                break;
            }

            sleep($retryWait);

            $this->retryFailed($instances);
        }

        foreach ($instances as $curlInstance) {
            $curlInstance->setContent(curl_multi_getcontent($curlInstance->getHandle()));
        }

        curl_multi_close($curlMultiInstance);
    }
private function subExec($instances, $retryCount = 0, $retryWait = 0)
    {
        $curlMultiInstance = curl_multi_init();

        foreach ($instances as $name => $curlInstance) {
            curl_multi_add_handle($curlMultiInstance, $curlInstance->getHandle());
        }

        do {
            curl_multi_exec($curlMultiInstance, $stillRunning);
            curl_multi_select($curlMultiInstance);
        } while ($stillRunning);

        for ($retry = 1; $retry <= $retryCount; $retry++) {
            $retryRequired = false;

            foreach ($instances as $curlInstance) {
                if (!$curlInstance->isSuccessful()) {
                    $retryRequired = true;
                    break;
                }
            }

            if (!$retryRequired) {
                break;
            }

            sleep($retryWait);

            $this->retryFailed($instances);
        }

        foreach ($instances as $curlInstance) {
            $curlInstance->setContent(curl_multi_getcontent($curlInstance->getHandle()));
        }

        curl_multi_close($curlMultiInstance);
    }
private function subExec ( $ instances , $ retryCount = 0 , $ retryWait = 0 ) { $ curlMultiInstance = curl_multi_init ( ) ; foreach ( $ instances as $ name => $ curlInstance ) { curl_multi_add_handle ( $ curlMultiInstance , $ curlInstance -> getHandle ( ) ) ; } do { curl_multi_exec ( $ curlMultiInstance , $ stillRunning ) ; curl_multi_select ( $ curlMultiInstance ) ; } while ( $ stillRunning ) ; for ( $ retry = 1 ; $ retry <= $ retryCount ; $ retry ++ ) { $ retryRequired = false ; foreach ( $ instances as $ curlInstance ) { if ( ! $ curlInstance -> isSuccessful ( ) ) { $ retryRequired = true ; break ; } } if ( ! $ retryRequired ) { break ; } sleep ( $ retryWait ) ; $ this -> retryFailed ( $ instances ) ; } foreach ( $ instances as $ curlInstance ) { $ curlInstance -> setContent ( curl_multi_getcontent ( $ curlInstance -> getHandle ( ) ) ) ; } curl_multi_close ( $ curlMultiInstance ) ; }
Execute the requests of all given Curl instances

@param Curl[] $instances An array of Curl instances (key = name of instance)
@param int $retryCount The maximum number of retries
@param int $retryWait Time in seconds to wait between each try
Execute the requests of all given Curl instances