protected function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
    {
        // Increment the retry count
        ++$options['retry_count'];

        // Determine the delay timeout
        $delayTimeout = $this->determineDelayTimeout($options, $response);

        // Callback?
        if ($options['on_retry_callback']) {
            \call_user_func(
                $options['on_retry_callback'],
                (int) $options['retry_count'],
                (float) $delayTimeout,
                $request,
                $options,
                $response
            );
        }

        // Delay!
        usleep($delayTimeout * 1000000);

        // Return
        return $this($request, $options);
    }
protected function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
    {
        // Increment the retry count
        ++$options['retry_count'];

        // Determine the delay timeout
        $delayTimeout = $this->determineDelayTimeout($options, $response);

        // Callback?
        if ($options['on_retry_callback']) {
            \call_user_func(
                $options['on_retry_callback'],
                (int) $options['retry_count'],
                (float) $delayTimeout,
                $request,
                $options,
                $response
            );
        }

        // Delay!
        usleep($delayTimeout * 1000000);

        // Return
        return $this($request, $options);
    }
protected function doRetry ( RequestInterface $ request , array $ options , ResponseInterface $ response = null ) { // Increment the retry count ++ $ options [ 'retry_count' ] ; // Determine the delay timeout $ delayTimeout = $ this -> determineDelayTimeout ( $ options , $ response ) ; // Callback? if ( $ options [ 'on_retry_callback' ] ) { \ call_user_func ( $ options [ 'on_retry_callback' ] , ( int ) $ options [ 'retry_count' ] , ( float ) $ delayTimeout , $ request , $ options , $ response ) ; } // Delay! usleep ( $ delayTimeout * 1000000 ) ; // Return return $ this ( $ request , $ options ) ; }
Retry the request

Increments the retry count, determines the delay (timeout), executes callbacks, sleeps, and re-send the request

@param RequestInterface $request
@param array $options
@param ResponseInterface|null $response
@return
Retry the request