Skip to content

Commit b66067b

Browse files
committed
docs: explain that a success can open the circuit in rate mode
1 parent 5491c98 commit b66067b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎docs/resilience.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ breaker = AsyncCircuitBreaker(
222222
)
223223
```
224224

225+
Once the window holds at least `minimum_calls` outcomes, the rate is checked after every outcome, successes included. A success can therefore be the call that opens the circuit. With `minimum_calls=4` and a threshold of `0.5`, three failures leave the circuit closed because the window holds only three outcomes; a fourth call that succeeds brings it to four, the rate is 3/4, and the circuit opens. That call still returns its response to the caller, and the next request is rejected with `CircuitOpenError`.
226+
225227
In rate mode `failure_threshold` is ignored. Recovery through HALF_OPEN works the same in both modes, and the sync `CircuitBreaker` takes the same parameters.
226228

227229
### State introspection

0 commit comments

Comments
 (0)