PHPackages                             aguimaraes/circuit-breaker - 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. aguimaraes/circuit-breaker

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

aguimaraes/circuit-breaker
==========================

Implementation of the circuit breaker pattern

v2.0.0(6y ago)1060.0k—0%2Apache-2.0PHPPHP &gt;=7.0CI failing

Since Mar 24Pushed 3w ago3 watchersCompare

[ Source](https://github.com/aguimaraes/circuit-breaker)[ Packagist](https://packagist.org/packages/aguimaraes/circuit-breaker)[ RSS](/packages/aguimaraes-circuit-breaker/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

circuit-breaker
===============

[](#circuit-breaker)

[![CircleCI](https://camo.githubusercontent.com/db5f813975b197b9c244654b65dab6030f812415d5483cf3d10b5a1c32982f26/68747470733a2f2f636972636c6563692e636f6d2f67682f616775696d61726165732f636972637569742d627265616b65722e7376673f7374796c653d737667)](https://circleci.com/gh/aguimaraes/circuit-breaker)[![codecov](https://camo.githubusercontent.com/cddf4602793b67f4acab059c341d99f362a983e05524f9e028de927164641276/68747470733a2f2f636f6465636f762e696f2f67682f616775696d61726165732f636972637569742d627265616b65722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/aguimaraes/circuit-breaker)

### Usage example

[](#usage-example)

```
$cb = new Aguimaraes\CircuitBreaker(
    new Aguimaraes\Adapter\ACPu()
);

// number of errors necessary to open the circuit
$cb->setThreshold('my-service', 10);

// wait x seconds to check if service is back
$cb->setTimeout('my-service', 60);

$response = null;

if ($cb->isAvailable('my-service')) {
    try {

        $response = $service->makeCall();
        $cb->reportSuccess('my-service');

    } catch (ServiceException $e) {

        $cb->reportFailure('my-service');

    } catch (NonServiceRelatedException $e) {

        // something went wrong and it was not the service fault

    }
}
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance62

Regular maintenance activity

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 85.3% 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 ~103 days

Recently: every ~219 days

Total

10

Last Release

2350d ago

Major Versions

v0.0.7 → v1.0.02018-10-04

v1.0.1 → v2.0.02019-10-15

PHP version history (6 changes)v0.0.1PHP ^7.1

v0.0.2PHP ^5.6

v0.0.3PHP &gt;=7.1

v0.0.5PHP &gt;=5.6

v1.0.0PHP &gt;=7.2

v2.0.0PHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![aguimaraes](https://avatars.githubusercontent.com/u/131234?v=4)](https://github.com/aguimaraes "aguimaraes (58 commits)")[![boekkooi-fresh](https://avatars.githubusercontent.com/u/20040010?v=4)](https://github.com/boekkooi-fresh "boekkooi-fresh (9 commits)")[![franklinrabay](https://avatars.githubusercontent.com/u/6410844?v=4)](https://github.com/franklinrabay "franklinrabay (1 commits)")

---

Tags

circuit-breakermicroservices

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aguimaraes-circuit-breaker/health.svg)

```
[![Health](https://phpackages.com/badges/aguimaraes-circuit-breaker/health.svg)](https://phpackages.com/packages/aguimaraes-circuit-breaker)
```

###  Alternatives

[ericmann/wp-session-manager

Prototype session management for WordPress.

26923.6k](/packages/ericmann-wp-session-manager)

PHPackages © 2026

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