Easy PHP Circuit Breaker: Check the status of circuit breaker conditions

Recommend this page to a friend!
  Info   View files Documentation   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 30 All time: 10,152 This week: 347Up
Version License PHP version Categories
php-easy-breaker 1.0The PHP License7Language, Design Patterns, PHP 7
Description Author

This package can be used to check the status of circuit breaker conditions.

It can create breaker objects that register breaker conditions by passing exceptions to be caught and functions that return strings which define messages to be returned when breaker conditions occur.

The package can also add one or more breaker objects to be evaluated to determine if at least one of the breaker conditions occurred and the application may have to be stopped.

Picture of DeGraciaMathieu
  Performance   Level  
Name: DeGraciaMathieu <contact>
Classes: 9 packages by
Country: France France
Age: ???
All time rank: 337187 in France France
Week rank: 650 Up20 in France France Up
Innovation award
Innovation award
Nominee: 5x


<p align="center"> <a href="https://travis-ci.org/DeGraciaMathieu/php-easy-breaker"><img src="https://travis-ci.org/DeGraciaMathieu/php-easy-breaker.svg?branch=master" alt="Build Status"></a> <a href="https://scrutinizer-ci.com/g/DeGraciaMathieu/php-easy-breaker/?branch=master"><img src="https://scrutinizer-ci.com/g/DeGraciaMathieu/php-easy-breaker/badges/coverage.png?b=master" alt="Code Coverage"></a> <img src="https://img.shields.io/travis/php-v/DeGraciaMathieu/php-easy-breaker.svg" alt="PHP range"> <a href="https://packagist.org/packages/degraciamathieu/php-easy-breaker"><img src="https://img.shields.io/packagist/v/degraciamathieu/php-easy-breaker.svg?style=flat-square" alt="Latest Version on Packagist"></a> <a href='https://packagist.org/packages/degraciamathieu/php-easy-breaker'><img src='https://img.shields.io/packagist/dt/degraciamathieu/php-easy-breaker.svg?style=flat-square' /></a> </p>


PHP implementation of circuit breaker pattern.


Run in console below command to download package to your project:

composer require degraciamathieu/php-easy-breaker


require __DIR__.'/vendor/autoload.php';

use Exception;
use DeGraciaMathieu\EasyBreaker\Breaker;
use DeGraciaMathieu\EasyBreaker\CircuitBreaker;

$firstBreaker = (new Breaker)
    ->do(function(Exception $e){
        return "it's broken.";

$secondBreaker = (new Breaker)
    ->do(function(Exception $e){
        return "realy broken.";

$thirdBreaker = (new Breaker)
    ->do(function(AnotherException $e){
        return "boom.";

$results = (new CircuitBreaker())
        throw new Exception();


// array(2) {
//   [0]=>
//   string(12) "it's broken."
//   [1]=>
//   string(18) "realy broken."
// }
  Files folder image Files  
File Role Description
Files folder imagesrc (3 files)
Files folder imagetests (1 file)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file Breaker.php Class Class source
  Plain text file BreakerAggregator.php Class Class source
  Plain text file CircuitBreaker.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file CircuitBreakerTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,152
This week:347Up

For more information send a message to info at phpclasses dot org.