PHPackages                             patinthehat/backoffv2 - 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. patinthehat/backoffv2

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

patinthehat/backoffv2
=====================

Backoff algorithms implemented in PHP

v1.1.0(9y ago)112MITPHPPHP &gt;=5.5.0

Since Feb 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/patinthehat/BackoffV2)[ Packagist](https://packagist.org/packages/patinthehat/backoffv2)[ RSS](/packages/patinthehat-backoffv2/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (5)Used By (0)

BackoffV2 [![Build Status](https://camo.githubusercontent.com/f3d41e75ccb1b44420d71fdded80115f461d05d4b59d2945ded361bf95a69083/68747470733a2f2f7472617669732d63692e6f72672f706174696e7468656861742f4261636b6f666656322e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/patinthehat/BackoffV2)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#backoffv2-)

---

BackoffV2 is a PHP 5.5+ library implementing various backoff algorithms, such as [exponential backoff](http://en.wikipedia.org/wiki/Exponential_backoff).

This library only returns a backoff delay amount based on the selected algorithms; implementation of the actual delay mechanism (such as [sleep()](http://php.net/manual/en/function.sleep.php)) is left to the user.

---

#### Installation

[](#installation)

Install BackoffV2 with [Composer](https://getcomposer.org/):

`composer require patinthehat/backoffv2`

---

#### Implementation

[](#implementation)

"Jitter" is implemented, if you choose to use it. Jitter is a small, variable amount of time that is added to the backoff amount.

---

Available Jitter algorithms (roughly based on [this post](https://www.awsarchitectureblog.com/2015/03/backoff.html)) include:

- NoJitter - No jitter
- FullJitter - Standard jitter amount
- EqualJitter - More consistent jitter amounts
- DecorrelatedJitter - Higher jitter amounts

---

Backoff algorithms include:

- ExponentialBackoff - exponentially increase the backoff amount
- ConstantBackoff - use the same backoff amount, regardless of the attempt count.
- LinearBackoff - linear increase of the backoff amount, i.e. 1, 2, 3, 4, ...

---

#### Usage

[](#usage)

---

##### Using the Backoff class

[](#using-the-backoff-class)

BackoffV2 implements a main class, `Backoff`, that acts as a container and manager for the backoff and jitter algorithms you choose. The constructor signature for `Backoff` is:

```
public function __construct($maxBackoff, BackoffStrategyInterface $backoff, JitterStrategyInterface $jitter)
```

Usage is simple:

```
include 'vendor/autoload.php';
use BackoffV2\Backoff;
use BackoffV2\Backoff\ExponentialBackoff;
use BackoffV2\Jitter\FullJitter;

$b = new Backoff(15, new ExponentialBackoff, new FullJitter);

echo 'backoff = '.$b->getBackoff() . PHP_EOL;
echo 'backoff = '.$b->getBackoff() . PHP_EOL;
echo 'backoff = '.$b->getBackoff() . PHP_EOL;
echo 'backoff = '.$b->getBackoff() . PHP_EOL;
echo 'backoff = '.$b->getBackoff() . ' (attempt ' . $b->getAttempt().')' . PHP_EOL;
$b->reset();
```

---

#### License

[](#license)

BackoffV2 is available under the [MIT License](LICENSE).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

3413d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5508707?v=4)[Patrick Organ](/maintainers/patinthehat)[@patinthehat](https://github.com/patinthehat)

---

Tags

algorithmsbackoffbackoff-algorithmsbackoff-strategycomposer-packageexponential-backoffphp

### Embed Badge

![Health badge](/badges/patinthehat-backoffv2/health.svg)

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

###  Alternatives

[rich-davis1/phpw2v

A PHP implementation of Word2Vec, a popular word embedding algorithm created by Tomas Mikolov and popularized by Radim Řehůřek &amp; Peter Sojka with the Gensim Python library.

471.2k](/packages/rich-davis1-phpw2v)

PHPackages © 2026

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