aedart/athenaeum-circuits

Circuit Breaker for Laravel

Maintainers

👁 aedart

Package info

github.com/aedart/athenaeum-circuits

Homepage

pkg:composer/aedart/athenaeum-circuits

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

10.10.0 2026-06-23 06:47 UTC

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 667b86d1f39a373eed532cdaec9eff75725a72e4

  • Alin Eugen Deac <aedart.woop@gmail.com>

circuit breakerAthenaeum

This package is auto-updated.

Last update: 2026-06-23 06:48:06 UTC


README

This package offers a Circuit Breaker that can be used to "[...] detect failures and encapsulates the logic of preventing a failure from constantly recurring, during maintenance, temporary external system failure or unexpected system difficulties[...]" (wiki).

A detailed explanation of how the Circuit Breaker Pattern works, can be found on Medium and Martin Fowler's blog

Example

<?php

use Aedart\Circuits\Traits\CircuitBreakerManagerTrait;

class WeatherService
{
 use CircuitBreakerManagerTrait;

 public function forecast()
 {
 $circuitBreaker = $this->getCircuitBreakerManager()
 ->create('weather_service');

 return $circuitBreaker->attempt(function() {
 // Perform 3rd party API call... not shown here
 }, function(){
 // Service has failed and is unavailable, do something else...
 });
 }
}

Documentation

Please read the official documentation for additional information.

Repository

The mono repository is located at github.com/aedart/athenaeum

Versioning

This package follows Semantic Versioning 2.0.0

License

BSD-3-Clause, Read the LICENSE file included in this package