Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct (BackoffStrategyInterface $strategy=null) | |
onRequestPoll (Event $event) | |
onRequestSent (Event $event) | |
![]() | |
addSubscriber (EventSubscriberInterface $subscriber) | |
dispatch ($eventName, array $context=array()) | |
getEventDispatcher () | |
setEventDispatcher (EventDispatcherInterface $eventDispatcher) | |
Static Public Member Functions | |
static | getAllEvents () |
static | getExponentialBackoff ( $maxRetries=3, array $httpCodes=null, array $curlCodes=null) |
static | getSubscribedEvents () |
Data Fields | |
const | DELAY_PARAM = CurlMultiInterface::BLOCKING |
const | RETRY_EVENT = 'plugins.backoff.retry' |
const | RETRY_PARAM = 'plugins.backoff.retry_count' |
Protected Attributes | |
$strategy | |
![]() | |
$eventDispatcher | |
Plugin to automatically retry failed HTTP requests using a backoff strategy
Definition at line 16 of file BackoffPlugin.php.
Guzzle\Plugin\Backoff\BackoffPlugin::__construct | ( | BackoffStrategyInterface | $strategy = null | ) |
BackoffStrategyInterface | $strategy | The backoff strategy used to determine whether or not to retry and the amount of delay between retries. |
Definition at line 32 of file BackoffPlugin.php.
References Guzzle\Plugin\Backoff\BackoffPlugin\$strategy.
|
static |
Get a list of all of the events emitted from the class
Reimplemented from Guzzle\Common\AbstractHasDispatcher.
Definition at line 60 of file BackoffPlugin.php.
Referenced by Guzzle\Tests\Plugin\Backoff\BackoffPluginTest\testHasEventList().
|
static |
Retrieve a basic truncated exponential backoff plugin that will retry HTTP errors and cURL errors
int | $maxRetries | Maximum number of retries |
array | $httpCodes | HTTP response codes to retry |
array | $curlCodes | cURL error codes to retry |
Definition at line 46 of file BackoffPlugin.php.
Referenced by Guzzle\Tests\Plugin\Backoff\BackoffPluginTest\testCreatesDefaultExponentialBackoffPlugin().
|
static |
Returns an array of event names this subscriber wants to listen to.
The array keys are event names and the value can be:
For instance:
Implements Symfony\Component\EventDispatcher\EventSubscriberInterface.
Definition at line 65 of file BackoffPlugin.php.
References Guzzle\Http\Curl\CurlMultiInterface\POLLING_REQUEST.
Guzzle\Plugin\Backoff\BackoffPlugin::onRequestPoll | ( | Event | $event | ) |
Called when a request is polling in the curl multi object
Event | $event |
Definition at line 110 of file BackoffPlugin.php.
References Guzzle\Http\Message\EntityEnclosingRequestInterface\getBody().
Guzzle\Plugin\Backoff\BackoffPlugin::onRequestSent | ( | Event | $event | ) |
Called when a request has been sent and isn't finished processing
Event | $event |
Definition at line 79 of file BackoffPlugin.php.
References Guzzle\Common\AbstractHasDispatcher\dispatch(), and Guzzle\Http\Message\RequestInterface\STATE_TRANSFER.
|
protected |
Backoff strategy
Definition at line 26 of file BackoffPlugin.php.
Referenced by Guzzle\Plugin\Backoff\BackoffPlugin\__construct().
const Guzzle\Plugin\Backoff\BackoffPlugin::DELAY_PARAM = CurlMultiInterface::BLOCKING |
const Guzzle\Plugin\Backoff\BackoffPlugin::RETRY_EVENT = 'plugins.backoff.retry' |
Definition at line 20 of file BackoffPlugin.php.
Referenced by Guzzle\Tests\Plugin\Backoff\BackoffPluginTest\getSubscribedEvents(), and Guzzle\Plugin\Backoff\BackoffLogger\getSubscribedEvents().
const Guzzle\Plugin\Backoff\BackoffPlugin::RETRY_PARAM = 'plugins.backoff.retry_count' |
Definition at line 19 of file BackoffPlugin.php.
Referenced by Guzzle\Tests\Plugin\Backoff\BackoffPluginTest\testRetriesRequests().