protected function pushRetryMiddleware(callable $decider, callable $delay = null)
    {
        $this->stack->push(
            Middleware::retry($decider, $delay), 'hubtel-retry-request'
        );

        return $this->stack;
    }
protected function pushRetryMiddleware(callable $decider, callable $delay = null)
    {
        $this->stack->push(
            Middleware::retry($decider, $delay), 'hubtel-retry-request'
        );

        return $this->stack;
    }
protected function pushRetryMiddleware ( callable $ decider , callable $ delay = null ) { $ this -> stack -> push ( Middleware :: retry ( $ decider , $ delay ) , 'hubtel-retry-request' ) ; return $ this -> stack ; }
Pushes a Retry Middleware to the Guzzle Client Handler Stack.

Middleware that retries requests based on the boolean result of
invoking the provided "decider" function.

If no delay function is provided, a simple implementation of exponential
backoff will be utilized.

@param  callable $decider Function that accepts the number of retries,
a request, [response], and [exception] and
returns true if the request is to be retried.
@param  callable $delay   Function that accepts the number of retries and
returns the number of milliseconds to delay.
@return \GuzzleHttp\HandlerStack
@see    http://docs.guzzlephp.org/en/stable/handlers-and-middleware.html Guzzle: Handlers and Middlewares.
Pushes a Retry Middleware to the Guzzle Client Handler Stack .