PHPackages                             antelucangizmos/guzzle-retry-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. antelucangizmos/guzzle-retry-handler

ActiveProject[HTTP &amp; Networking](/categories/http)

antelucangizmos/guzzle-retry-handler
====================================

test guzzle client with retry support

0.1.2(2y ago)114GPL-3.0-or-laterPHP

Since Jun 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/agentE/simpleGuzzleRetryHandler)[ Packagist](https://packagist.org/packages/antelucangizmos/guzzle-retry-handler)[ RSS](/packages/antelucangizmos-guzzle-retry-handler/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Simple Retry Strategy for Guzzle 7
==================================

[](#simple-retry-strategy-for-guzzle-7)

[![Shields](https://camo.githubusercontent.com/92fe0dcc1e92d08c0b1c4c8b84be617053e87aa7efb21b7fa515390e1eeb6839/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d53696d706c6525323047757a7a6c65253230526574727925323048616e646c65722d677265656e)](https://camo.githubusercontent.com/92fe0dcc1e92d08c0b1c4c8b84be617053e87aa7efb21b7fa515390e1eeb6839/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d53696d706c6525323047757a7a6c65253230526574727925323048616e646c65722d677265656e)[![Shields](https://camo.githubusercontent.com/d1d292d047448acf2a8a262bd51cfc560879526aca80f2a34933be7ee1391230/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c2d7465616c)](https://camo.githubusercontent.com/d1d292d047448acf2a8a262bd51cfc560879526aca80f2a34933be7ee1391230/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c2d7465616c)

APIs might implement rate limiting, and if they do your clients might experience `429 Too Many Requests` responses with a `Retry-After` header, informing your client how long it should wait before making the next request.

[Guzzle](https://gihub.com/guzzle/guzzle) includes a [retry middleware](https://github.com/guzzle/guzzle/blob/master/src/RetryMiddleware.php) class that can be used to handle this.

The implementation in this project is a PoC, so feel free to build upon it, and comment if you think something should be added / removed.

Example usage
-------------

[](#example-usage)

```
require dirname(__DIR__, 2) . '/vendor/autoload.php';

use Ag\Guzzle\Handler\Retry;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;

class TestRetry
{
    public function test(int $maxRetries = 5)
    {
        $handlerStack = HandlerStack::create(new CurlHandler());
        $retry = new Retry($maxRetries);
        $handlerStack->push(Middleware::retry($retry->retryDecider(), $retry->retryDelay()));

        $client = new Client(array('handler' => $handlerStack));

        $response = $client->request(
            'GET',
            // @ToDo replace to a real url!!!
            'https://some-url-here'
        )->getBody()->getContents();

        return print_r($response, true);
    }
}

try {
    $TestRetry = new TestRetry();
    $response = $TestRetry->test(5);
    echo $response . PHP_EOL;
} catch (ConnectException $e) {
    echo $e->getMessage() . PHP_EOL;
}
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

744d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b69e9179f8b8748083e609e9054aee14dc933284737bfd3397485dc250f1c758?d=identicon)[otbc\_erik](/maintainers/otbc_erik)

---

Top Contributors

[![agentE](https://avatars.githubusercontent.com/u/976211?v=4)](https://github.com/agentE "agentE (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/antelucangizmos-guzzle-retry-handler/health.svg)

```
[![Health](https://phpackages.com/badges/antelucangizmos-guzzle-retry-handler/health.svg)](https://phpackages.com/packages/antelucangizmos-guzzle-retry-handler)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[guzzlehttp/guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.

25711.0M191](/packages/guzzlehttp-guzzle-services)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
