https://github.com/aedart/athenaeum-circuits
[READ ONLY] Athenaeum Circuits package - see https://github.com/aedart/athenaeum
https://github.com/aedart/athenaeum-circuits
circuit-breaker
Last synced: 11 months ago
JSON representation
[READ ONLY] Athenaeum Circuits package - see https://github.com/aedart/athenaeum
- Host: GitHub
- URL: https://github.com/aedart/athenaeum-circuits
- Owner: aedart
- License: bsd-3-clause
- Created: 2020-05-24T07:13:03.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-07-21T08:07:09.000Z (about 1 year ago)
- Last Synced: 2025-07-21T10:13:11.940Z (about 1 year ago)
- Topics: circuit-breaker
- Language: PHP
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Athenaeum Circuits
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](https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern)).
A detailed explanation of how the Circuit Breaker Pattern works, can be found on [Medium](https://medium.com/@soumendrak/circuit-breaker-design-pattern-997c3521c1c4) and [Martin Fowler's blog](https://martinfowler.com/bliki/CircuitBreaker.html)
## Example
```php
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](https://aedart.github.io/athenaeum/) for additional information.
## Repository
The mono repository is located at [github.com/aedart/athenaeum](https://github.com/aedart/athenaeum)
## Versioning
This package follows [Semantic Versioning 2.0.0](http://semver.org/)
## License
[BSD-3-Clause](http://spdx.org/licenses/BSD-3-Clause), Read the LICENSE file included in this package