PHPackages                             netlogix/retry - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. netlogix/retry

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

netlogix/retry
==============

Retries a specific PHP code fragment.

1.0.0(11mo ago)1132.0k↑50.8%1MITPHPPHP &gt;=8.1CI passing

Since Aug 5Pushed 11mo agoCompare

[ Source](https://github.com/netlogix/retry)[ Packagist](https://packagist.org/packages/netlogix/retry)[ RSS](/packages/netlogix-retry/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

Netlogix Retry
==============

[](#netlogix-retry)

Retries a specific PHP code fragment (called a "task") as long as the "when" condition evaluates to `true`.

```
(new \Netlogix\Retry\Retry())
    ->when(condition: fn(int $incarnation) => $incarnation < PHP_INT_MAX)
    ->task(subject: fn () => throw new \RuntimeException('false'));
```

There is a shorthand method for counting retries and sleeping between attempts with increasing intervals.

```
(new \Netlogix\Retry\Retry())
    /**
     * http://backoffcalculator.com/?attempts=5&rate=1&interval=0.5
     * = (0.5 + 1 + 1.5 + 2.0 + 2.5) seconds
     * = 7.5 seconds
     */
    ->withExponentialBackoff(retryInterval: 0.5, maxRetries: 5)
    ->onExceptionsOfType(\Doctrine\DBAL\Exception\DeadlockException::class)
    ->task(fn () => $dbal->executeQuery($statement));
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance52

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

333d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/667b5107f4c2ea180baa00166c2ee3f2a1b412ce22768d6e81bb09323d1c7fe0?d=identicon)[netlogix](/maintainers/netlogix)

![](https://avatars.githubusercontent.com/u/1595908?v=4)[Stephan Schuler](/maintainers/stephanschuler)[@stephanschuler](https://github.com/stephanschuler)

---

Top Contributors

[![stephanschuler](https://avatars.githubusercontent.com/u/1595908?v=4)](https://github.com/stephanschuler "stephanschuler (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/netlogix-retry/health.svg)

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

###  Alternatives

[modmore/alpacka

Generic MODX service class and collection of utilities, used by the modmore team, but also available for third party developers.

146.7k](/packages/modmore-alpacka)

PHPackages © 2026

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