PHPackages                             ekomobile/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. ekomobile/retry

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

ekomobile/retry
===============

Retry with backoff

0.4.0(7y ago)1521MITPHPPHP &gt;=7.1

Since Dec 11Pushed 7y ago2 watchersCompare

[ Source](https://github.com/ekomobile/retry)[ Packagist](https://packagist.org/packages/ekomobile/retry)[ RSS](/packages/ekomobile-retry/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Exponential Backoff
===================

[](#exponential-backoff)

[![Build Status](https://camo.githubusercontent.com/11bbd6252ef0e281642850e772f2b155bfa61fc6c32030fd350184e92fcdd684/68747470733a2f2f7472617669732d63692e6f72672f656b6f6d6f62696c652f72657472792e737667)](https://travis-ci.org/ekomobile/retry)[![GitHub release](https://camo.githubusercontent.com/8c863c17ad6ac2dada66154a12f4fc889449a9091eba16960131ed4256e7d579/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f656b6f6d6f62696c652f72657472792e737667)](https://github.com/ekomobile/retry/releases)[![Downloads](https://camo.githubusercontent.com/34b11d0213a12f2630d109339636f9553c943ffb0c38b8a0dcd89f9eb81fa7a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656b6f6d6f62696c652f72657472792e737667)](https://packagist.org/packages/ekomobile/retry)[![Coverage](https://camo.githubusercontent.com/fd631f3e93c23e6e221ff3876a9a638713b3ee524bb39529d9d03934bcc8768e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f656b6f6d6f62696c652f72657472792e737667)](https://codeclimate.com/github/ekomobile/retry)[![Maintainability](https://camo.githubusercontent.com/4dfde024136c5eac63daa6dc7a651f40b9029c55f48ab2b492d18cfb08b35354/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792d70657263656e746167652f656b6f6d6f62696c652f72657472792e737667)](https://codeclimate.com/github/ekomobile/retry)[![Tech debt](https://camo.githubusercontent.com/a2db03860f60d88fc6951db21ec65687e1d8ccebc7203613a38922cb6bc461f2/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f746563682d646562742f656b6f6d6f62696c652f72657472792e737667)](https://codeclimate.com/github/ekomobile/retry)

This is a PHP port of (thanks, @cenkalti), which is a port of the exponential backoff algorithm from [Google's HTTP Client Library for Java](https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java).

[Exponential backoff](http://en.wikipedia.org/wiki/Exponential_backoff)is an algorithm that uses feedback to multiplicatively decrease the rate of some process, in order to gradually find an acceptable rate. The retries exponentially increase and stop increasing when a certain threshold is met.

Examples
--------

[](#examples)

### Simple

[](#simple)

Retry with default exponential backoff.

```
(new Retry(function () {
    // workload ...
}))();
```

### Advanced

[](#advanced)

```
$operation = function () {
  // workload ...
  if ($somePermanentFailCondition) {
    throw new \Ekomobile\Retry\Exception\Permanent(new \Exception('Unretryable error'))
  }
  // ...
  throw new Exception('Retryable error')
};

$backoff = new \Ekomobile\Retry\Backoff\WithMaxRetries(new \Ekomobile\Retry\Backoff\Exponential(), 5);

$notify = function (\Throwable $e) {
  // $logger->log($e);
};

$retry = new \Ekomobile\Retry\Retry($operation, $backoff, $notify);
$retry();
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Every ~0 days

Total

4

Last Release

2714d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.2

0.4.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b16909b7d519612b67e5ada58780c958085c0cf0c93b7c78b7777d99246de6b6?d=identicon)[turboezh](/maintainers/turboezh)

---

Top Contributors

[![turboezh](https://avatars.githubusercontent.com/u/1132740?v=4)](https://github.com/turboezh "turboezh (19 commits)")

---

Tags

backoffexponential-backoffretry

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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