An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Solution10\CircuitBreaker

Simple circuit breaker class.

[![Build Status](https://travis-ci.org/Solution10/circuitbreaker.svg?branch=master)](https://travis-ci.org/Solution10/circuitbreaker)
[![Latest Stable Version](https://poser.pugx.org/solution10/circuitbreaker/v/stable.svg)](https://packagist.org/packages/solution10/circuitbreaker)
[![Total Downloads](https://poser.pugx.org/solution10/circuitbreaker/downloads.svg)](https://packagist.org/packages/solution10/circuitbreaker)
[![License](https://poser.pugx.org/solution10/circuitbreaker/license.svg)](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)