protected function determineDelayTimeout(array $options, ResponseInterface $response = null)
    {
        if (\is_callable($options['default_retry_multiplier'])) {
            $defaultDelayTimeout = (float) \call_user_func(
                $options['default_retry_multiplier'],
                $options['retry_count'],
                $response
            );
        } else {
            $defaultDelayTimeout = (float) $options['default_retry_multiplier'] * $options['retry_count'];
        }

        // Retry-After can be a delay in seconds or a date
        // (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)
        if ($response && $response->hasHeader('Retry-After')) {
            return
                $this->deriveTimeoutFromHeader($response->getHeader('Retry-After')[0])
                ?: $defaultDelayTimeout;
        }

        return $defaultDelayTimeout;
    }
protected function determineDelayTimeout(array $options, ResponseInterface $response = null)
    {
        if (\is_callable($options['default_retry_multiplier'])) {
            $defaultDelayTimeout = (float) \call_user_func(
                $options['default_retry_multiplier'],
                $options['retry_count'],
                $response
            );
        } else {
            $defaultDelayTimeout = (float) $options['default_retry_multiplier'] * $options['retry_count'];
        }

        // Retry-After can be a delay in seconds or a date
        // (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)
        if ($response && $response->hasHeader('Retry-After')) {
            return
                $this->deriveTimeoutFromHeader($response->getHeader('Retry-After')[0])
                ?: $defaultDelayTimeout;
        }

        return $defaultDelayTimeout;
    }
protected function determineDelayTimeout ( array $ options , ResponseInterface $ response = null ) { if ( \ is_callable ( $ options [ 'default_retry_multiplier' ] ) ) { $ defaultDelayTimeout = ( float ) \ call_user_func ( $ options [ 'default_retry_multiplier' ] , $ options [ 'retry_count' ] , $ response ) ; } else { $ defaultDelayTimeout = ( float ) $ options [ 'default_retry_multiplier' ] * $ options [ 'retry_count' ] ; } // Retry-After can be a delay in seconds or a date // (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) if ( $ response && $ response -> hasHeader ( 'Retry-After' ) ) { return $ this -> deriveTimeoutFromHeader ( $ response -> getHeader ( 'Retry-After' ) [ 0 ] ) ? : $ defaultDelayTimeout ; } return $ defaultDelayTimeout ; }
Determine the delay timeout

Attempts to read and interpret the HTTP `Retry-After` header, or defaults
to a built-in incremental back-off algorithm.

@param ResponseInterface $response
@param array $options
@return float  Delay timeout, in seconds
Determine the delay timeout