Class Guzzle\Plugin\Backoff\BackoffPlugin

InheritanceGuzzle\Plugin\Backoff\BackoffPlugin » Guzzle\Common\AbstractHasDispatcher
ImplementsGuzzle\Common\HasDispatcherInterface, Symfony\Component\EventDispatcher\EventSubscriberInterface

Plugin to automatically retry failed HTTP requests using a backoff strategy

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
DELAY_PARAM \Guzzle\Http\Curl\CurlMultiInterface::BLOCKING Guzzle\Plugin\Backoff\BackoffPlugin
RETRY_EVENT 'plugins.backoff.retry' Guzzle\Plugin\Backoff\BackoffPlugin
RETRY_PARAM 'plugins.backoff.retry_count' Guzzle\Plugin\Backoff\BackoffPlugin

Property Details

$strategy protected property

Backoff strategy

Method Details

__construct() public method

public void __construct ( Guzzle\Plugin\Backoff\BackoffStrategyInterface $strategy null )
$strategy Guzzle\Plugin\Backoff\BackoffStrategyInterface

The backoff strategy used to determine whether or not to retry and

                                      the amount of delay between retries.
getAllEvents() public static method

public static void getAllEvents ( )
getExponentialBackoff() public static method

Retrieve a basic truncated exponential backoff plugin that will retry HTTP errors and cURL errors

public static self getExponentialBackoff ( $maxRetries 3, array $httpCodes null, array $curlCodes null )
$maxRetries int

Maximum number of retries

$httpCodes array

HTTP response codes to retry

$curlCodes array

CURL error codes to retry

getSubscribedEvents() public static method

public static void getSubscribedEvents ( )
onRequestPoll() public method

Called when a request is polling in the curl multi object

public void onRequestPoll ( Guzzle\Common\Event $event )
$event Guzzle\Common\Event
onRequestSent() public method

Called when a request has been sent and isn't finished processing

public void onRequestSent ( Guzzle\Common\Event $event )
$event Guzzle\Common\Event