HubtelHandler
class HubtelHandler (View source)
Hubtel Handler Class
This class holds the hubtel handler and can be used with any Guzzle client to queue requests and middlewares.
Properties
| protected HandlerStack | $stack | Property for holding the handler stack on the instance | |
| protected Config | $config | Holds the configuration object |
Methods
Create the client handler.
Push the Header Middleware to the Handler Stack
Push the Header Middleware to the Handler Stack containing the bacic authentication in base64
Pushes a Retry Middleware to the Guzzle Client Handler Stack.
Function $decider callable
Function $delay
Details
at line 56
__construct(Config $config, HandlerStack $stack = null)
Constructor for the HubtelHandler class
at line 67
HandlerStack
createHandler()
Create the client handler.
at line 97
protected HandlerStack
pushHeaderMiddleware(callable $header)
Push the Header Middleware to the Handler Stack
at line 114
protected HandlerStack
pushBasicAuthMiddleware(callable $header)
Push the Header Middleware to the Handler Stack containing the bacic authentication in base64
at line 139
protected HandlerStack
pushRetryMiddleware(callable $decider, callable $delay = null)
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.
at line 157
static protected callable
decider()
Function $decider callable
Retuens a function that accepts the number of retries, a request, [response], and [exception] and returns true if the request is to be retried.
at line 197
static protected
delay()
Function $delay
returns a Function that accepts the number of retries and returns the number of milliseconds to delay.
The function is passed to the Retry Middleware as the second arguement and then pushed into the handler stack.