webclient / ext-retry
Retry extension for PSR-18 HTTP client
Fund package maintenance!
www.paypal.me/ddrv
Patreon
Requires
- php: ^7.0 || ^8.0
- psr/http-client: ^1.0
Requires (Dev)
- ext-json: *
- nyholm/psr7: ^1.3
- phpunit/phpunit: ^6.5 || ^7.5 || ^8.5 || ^9.5
- squizlabs/php_codesniffer: ^3.5
- webclient/fake-http-client: ^2.0
Suggests
- psr/http-client-implementation: Choice your favorite psr-18 implementation
Provides
This package is not auto-updated.
Last update: 2024-11-23 01:41:35 UTC
README
webclient/ext-retry
Retry extension for PSR-18 HTTP client.
Install
Install this package and your favorite psr-18 implementation.
composer require webclient/ext-retry:^1.0
Using
<?php use Webclient\Extension\Retry\RetryClientDecorator; use \Webclient\Extension\Retry\Timer\Timer; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; /** * @var ClientInterface $client Your PSR-18 HTTP Client * @var Timer $timer Timer implements * @var int $maxAttempts Max attempts */ $http = new RetryClientDecorator($client, $timer, $maxAttempts); /** @var RequestInterface $request */ $response = $http->sendRequest($request);