PHPackages                             eshta/resilient-task - 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. eshta/resilient-task

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

eshta/resilient-task
====================

Resilient Task Runner, A circuit breaker implementation, highly configurable task runner with number of max retries, back-off factor, maximum sleep time, and starting sleep time.

1.0.1(4y ago)6104[2 PRs](https://github.com/eshta/resilient-task/pulls)MITPHPPHP &gt;=7.0CI failing

Since Aug 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/eshta/resilient-task)[ Packagist](https://packagist.org/packages/eshta/resilient-task)[ Docs](https://github.com/eshta/resilient-task)[ RSS](/packages/eshta-resilient-task/feed)WikiDiscussions master Synced today

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

Resilient Task
==============

[](#resilient-task)

[![Build Status](https://camo.githubusercontent.com/f165171e512708d5b9d172828d69229700fec8587ff6a7774d4b96c9023a8329/68747470733a2f2f7472617669732d63692e6f72672f65736874612f726573696c69656e742d7461736b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/eshta/resilient-task)[![CodeCov](https://camo.githubusercontent.com/c0d1e5ea10310c58db0eb16a8877b2bb8a3b4463552f288eff2a64aa99265c94/68747470733a2f2f636f6465636f762e696f2f67682f65736874612f726573696c69656e742d7461736b2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/eshta/resilient-task)[![Release](https://camo.githubusercontent.com/683b2b08da9a28672fb8c1b0897b5fbb9e3c9e84f7bea8d1d5108c2bf0a8bdc9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f65736874612f726573696c69656e742d7461736b2e737667)](https://github.com/eshta/resilient-task/releases)[![PHPv](https://camo.githubusercontent.com/760725ab101f4684513ab83bc230bc6c9c59489a171a99228eeb8d62f7256574/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f65736874612f726573696c69656e742d7461736b2e737667)](http://www.php.net)[![Downloads](https://camo.githubusercontent.com/818f1414d54b68495717104d5422eee6e52d42e0a5d986d92b50bcbe7306e74c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65736874612f726573696c69656e742d7461736b2e737667)](https://packagist.org/packages/eshta/resilient-task)

Resilient Task Runner, A circuit breaker implementation, highly configurable task runner with number of max retries, back-off factor, maximum sleep time, and starting sleep time.

Usage
-----

[](#usage)

Install the `eshta/resilient-task` package:

```
$ composer require eshta/resilient-task
```

Example
-------

[](#example)

```
use GuzzleHttp\Exception\ConnectException;

$task = function() {
    try {
        $response = $client->request('GET', 'https://github.com/_abc_123_404');

        return $response;
    } catch (ConnectException $e) {
        echo Psr7\str($e->getRequest());
    }
};

$runner = new ResilientTaskRunner(10, 16, 0.5);
$response = $runner->run($task);

if (is_null($response)) {
    throw new MyFavouriteException('Service call failed!');
}
```

- try 10 times at most
- maximum sleep time between retries 16 seconds
- first sleep time is half a second
- back-off factor \[2 default\]: double sleeping time after each failed attempt

**Note:**: the runner will only stop when there is a non-null result returned by the task, or the max tries have been exhausted

Contributing
------------

[](#contributing)

See [CONTRIBUTING](CONTRIBUTING.md) and [Code of Conduct](CONDUCT.md), if you want to make contribution (pull request) or just build and test project on your own.

Resources
---------

[](#resources)

- [Changes History](CHANGES.md)
- [Bug Tracker](https://github.com/eshta/resilient-task/issues)
- [Authors](https://github.com/eshta/resilient-task/contributors)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

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 ~667 days

Total

2

Last Release

1793d ago

### Community

Maintainers

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

---

Top Contributors

[![0mars](https://avatars.githubusercontent.com/u/1150811?v=4)](https://github.com/0mars "0mars (17 commits)")

---

Tags

taskcircuit breakerresilientresilient processresilient procedurecircuit breaker pattern

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/eshta-resilient-task/health.svg)

```
[![Health](https://phpackages.com/badges/eshta-resilient-task/health.svg)](https://phpackages.com/packages/eshta-resilient-task)
```

###  Alternatives

[phing/phing

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

1.2k21.7M876](/packages/phing-phing)[ejsmont-artur/php-circuit-breaker

PHP Circuit Breaker component

169964.9k4](/packages/ejsmont-artur-php-circuit-breaker)[laravel-admin-ext/scheduling

Task scheduling extension for laravel-admin

93247.1k6](/packages/laravel-admin-ext-scheduling)[arara/process

Provides a better API to work with processes on Unix-like systems

16861.7k2](/packages/arara-process)[rewieer/taskschedulerbundle

Task Scheduler with CRON for Symfony

63242.1k](/packages/rewieer-taskschedulerbundle)[ttree/scheduler

Simple task scheduler for Neos Flow Framework

21108.8k1](/packages/ttree-scheduler)

PHPackages © 2026

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