PHPackages                             pransteter/etr-circuit-break-php - 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. pransteter/etr-circuit-break-php

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

pransteter/etr-circuit-break-php
================================

A little library to offer a simple manager of circuit breaker pattern.

00[9 issues](https://github.com/pransteter/etr-circuit-break-php/issues)PHP

Since Feb 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pransteter/etr-circuit-break-php)[ Packagist](https://packagist.org/packages/pransteter/etr-circuit-break-php)[ RSS](/packages/pransteter-etr-circuit-break-php/feed)WikiDiscussions develop Synced 1w ago

READMEChangelogDependenciesVersions (6)Used By (0)

Minimal Circuit Breaker
=======================

[](#minimal-circuit-breaker)

### Usage:

[](#usage)

```
// Configure

// - 1: Create a repository to persist and get the state:
class MyAppCBStateRepository implements \Pransteter\MinimalCB\Contracts\StateRepository
{
    public function saveState(string $index, \stdClass $state): bool
    {
        // code to save a state.
    }
    public function getState(string $index): ?\stdClass
    {
        // code to find a state.
    }
}

$repository = new MyAppCBStateRepository();

// - 2: Create a object of Configuration to set CB settings:
$configuration = new \Pransteter\MinimalCB\DTOs\Configuration(
    processIdentifier: 'get-weather-data-from-api',
    failedTriesLimit: 5,
    secondsToStayOpened: 300,
);

// Initialize MinimalCB:
$cb = new MinimalCB(
    $configuration,
    $repository,
)->begin();

// Check if can be executed
if($cb->canExecute()) {
    // procede with execution and get the result.
    try {
        // - In case of success
        $cb->end(true);
    } catch (\Throwable $e) {
        // - executed with failure
        $cb->end(false);
    }
}
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8230314?v=4)[Rômulo Pransteter](/maintainers/pransteter)[@pransteter](https://github.com/pransteter)

---

Top Contributors

[![pransteter](https://avatars.githubusercontent.com/u/8230314?v=4)](https://github.com/pransteter "pransteter (59 commits)")

### Embed Badge

![Health badge](/badges/pransteter-etr-circuit-break-php/health.svg)

```
[![Health](https://phpackages.com/badges/pransteter-etr-circuit-break-php/health.svg)](https://phpackages.com/packages/pransteter-etr-circuit-break-php)
```

PHPackages © 2026

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