https://github.com/solution10/circuitbreaker
Simple circuit breaker implementation
https://github.com/solution10/circuitbreaker
circuit-breaker composer-packages php stability
Last synced: 10 months ago
JSON representation
Simple circuit breaker implementation
- Host: GitHub
- URL: https://github.com/solution10/circuitbreaker
- Owner: solution10
- License: mit
- Created: 2016-05-14T22:47:55.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-25T13:20:54.000Z (over 9 years ago)
- Last Synced: 2025-02-26T10:04:40.155Z (11 months ago)
- Topics: circuit-breaker, composer-packages, php, stability
- Language: PHP
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Solution10\CircuitBreaker
Simple circuit breaker class.
[](https://travis-ci.org/Solution10/circuitbreaker)
[](https://packagist.org/packages/solution10/circuitbreaker)
[](https://packagist.org/packages/solution10/circuitbreaker)
[](https://packagist.org/packages/solution10/circuitbreaker)
## Features
- Adjustable thresholds
- Adjustable cooldowns
- Events on change
- Any Doctine\Common\Cache\Cache implementation for persistence
## Installation
Installation is via composer, in the usual manner:
```sh
$ composer require solution10/circuitbreaker
```
## Example usage
```php
isClosed()) {
$response = doSomething();
if ($response) {
$breaker->success();
} else {
$breaker->failure();
}
} else {
gracefullyDegrade();
}
```
### Userguide
[Check out the Wiki](https://github.com/Solution10/circuitbreaker/wiki)
(or the /docs folder in the repo)
## PHP Requirements
- PHP >= 5.5
## Author
Alex Gisby: [GitHub](http://github.com/alexgisby), [Twitter](http://twitter.com/alexgisby)
## License
[MIT](http://github.com/solution10/circuitbreaker/tree/master/LICENSE.md)
## Contributing
[Contributors Notes](http://github.com/solution10/circuitbreaker/tree/master/CONTRIBUTING.md)