Opens the breaker after a number of failures within a time window.
Only failures are tracked: the breaker opens when threshold failures
happen within window milliseconds of each other. Successes do not affect
it, and failures older than the window stop counting.
Options
:threshold- the number of failures that opens the breaker. Required.With
1, the first failure opens the breaker and:windowhas no effect, likeRexsilient.CircuitBreaker.Strategy.Countwith the same threshold.The breaker keeps the time of the last
threshold - 1failures, 8 bytes each, so memory grows with the threshold.:window- the time, in milliseconds, those failures must fit in. Required.
Examples
strategy Rexsilient.CircuitBreaker.Strategy.SlidingWindow,
threshold: 5,
window: :timer.seconds(10)