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(1y ago)114GPL-3.0-or-laterPHP

Since Jun 19Pushed 1y 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 1mo ago

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

21

—

LowBetter than 19% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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

692d 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

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

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