diff --git a/content/docs/learn/resilience/circuitbreaker.md b/content/docs/learn/resilience/circuitbreaker.md index 29e9f7fa..146a1ce0 100644 --- a/content/docs/learn/resilience/circuitbreaker.md +++ b/content/docs/learn/resilience/circuitbreaker.md @@ -71,6 +71,19 @@ in _Cloud Design Patterns_. ::: +## Opening strategies + +Arrow offers different strategies to determine when the circuit breaker should open and short-circuit all incoming requests. The currently available ones are: + +- [_Count_](https://arrow-kt.github.io/arrow/arrow-resilience/arrow.resilience/-circuit-breaker/-opening-strategy/-count/index.html). + This strategy sets a maximum number of failures. Once this threshold is reached, the circuit breaker moves to _Open_. + Note that every time a request succeeds, the counter is set back to zero; the circuit breaker only + moves to _Open_ when the maximum number of failures happen **consecutively**. +- [_Sliding Window_](https://arrow-kt.github.io/arrow/arrow-resilience/arrow.resilience/-circuit-breaker/-opening-strategy/-sliding-window/index.html). + This strategy counts the number of failures within a given time window. Unlike the `Count` approach, the circuit breaker + will only move to `Open` if the number of failing requests tracked within the given period exceeds the threshold. As the + time window slides, the failures out of the window limits are ignored. + ## Arrow's [`CircuitBreaker`](https://arrow-kt.github.io/arrow/arrow-resilience/arrow.resilience/-circuit-breaker/index.html) Let's create a circuit breaker that only allows us to call a remote service twice. diff --git a/content/docs/learn/resilience/intro.md b/content/docs/learn/resilience/intro.md index 4678cea4..b520683e 100644 --- a/content/docs/learn/resilience/intro.md +++ b/content/docs/learn/resilience/intro.md @@ -24,7 +24,7 @@ even though a migration window is in place until Arrow 2.0. ::: -The Arrow Fx Resilience library implements three of the most critical design +The Arrow Resilience library implements three of the most critical design pattern around resilience: - Retry and repeat computations using [`Schedule`](../retry-and-repeat), diff --git a/content/docs/learn/resilience/saga.md b/content/docs/learn/resilience/saga.md index ccb0c69b..1aa69927 100644 --- a/content/docs/learn/resilience/saga.md +++ b/content/docs/learn/resilience/saga.md @@ -26,7 +26,7 @@ in _Cloud Design Patterns_. import io.kotest.matchers.shouldBe --> -Arrow Fx Resilience provides the [`saga`](https://arrow-kt.github.io/arrow/arrow-resilience/arrow.resilience/saga.html) +Arrow Resilience provides the [`saga`](https://arrow-kt.github.io/arrow/arrow-resilience/arrow.resilience/saga.html) function, which creates a new scope where compensating actions can be declared alongside the action to perform. This is done by the [`saga` function in `SagaScope`](https://arrow-kt.github.io/arrow/arrow-resilience/arrow.resilience/-saga-scope/saga.html).