| 1 | <?php declare(strict_types=1); |
||
| 5 | class CircuitBreaker implements PolicyInterface |
||
| 6 | { |
||
| 7 | private $failureThreshold; |
||
| 8 | private $failureAttempts; |
||
| 9 | |||
| 10 | private $successThreshold; |
||
| 11 | private $successAttempts; |
||
| 12 | |||
| 13 | private $delay; |
||
| 14 | |||
| 15 | private $on = []; |
||
| 16 | |||
| 17 | private $timeout; |
||
| 18 | |||
| 19 | public function isAvailable() : bool |
||
| 23 | |||
| 24 | public function withFailureThreshold(int $threshold, int $attempts = null) : CircuitBreaker |
||
| 31 | |||
| 32 | public function withSuccessThreshold(int $threshold, int $attempts = null) : CircuitBreaker |
||
| 39 | |||
| 40 | public function withDelay(int $delay, int $unit) : CircuitBreaker |
||
| 46 | |||
| 47 | public function failOnException(string $exception) : CircuitBreaker |
||
| 53 | |||
| 54 | public function failOnTimeOut(int $timeout, int $unit) : CircuitBreaker |
||
| 60 | |||
| 61 | public function run(callable $operation, $args = []) |
||
| 65 | } |
||
| 66 |