Download the PHP package christopheraseidl/circuit-breaker without Composer
On this page you can find all versions of the php package christopheraseidl/circuit-breaker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download christopheraseidl/circuit-breaker
More information about christopheraseidl/circuit-breaker
Files in christopheraseidl/circuit-breaker
Package circuit-breaker
Short Description A simple circuit breaker that prevents cascading failures.
License MIT
Homepage https://github.com/christopheraseidl/circuit-breaker
Informations about the package circuit-breaker
Circuit Breaker
A framework-agnostic circuit breaker implementation that prevents cascading failures by monitoring error rates and temporarily blocking requests when thresholds are exceeded.
Installation
You can install the package via composer:
Laravel Installation
The package auto-registers its service provider and automatically wires up Laravel's cache, logger, and mailer as adapters.
You may optionally publish the configuration file:
After publishing, update the config file to use Laravel's env() helper (recommended):
Optionally publish the email notification view:
Usage
Basic Example
Laravel Example
Monitoring Circuit State
Configuration
The default configuration covers common use cases:
Implementing Adapters
To use the circuit breaker outside Laravel, implement the required contracts:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Chris Seidl
- All Contributors
License
The MIT License (MIT). Please see License File for more information.