@@ -18,32 +18,32 @@ use tokio::time::Sleep;
1818/// This struct implements a circuit breaker pattern, which helps prevent cascading failures when interacting with unreliable services.
1919/// It monitors the success and failure of operations and transitions between three states:
2020///
21- /// * **Closed:** The circuit is operating normally, and operations are allowed to proceed.
22- /// * **Open:** Operations are immediately rejected without being executed. This prevents overloading the failing service.
23- /// * **Half-Open:** After a timeout period, the circuit enters a half-open state, allowing a limited number of operations to be executed.
24- /// If the probe succeeds, the circuit closes; otherwise, it returns to the open state.
21+ /// * **Closed:** The circuit is operating normally, and operations are allowed to proceed.
22+ /// * **Open:** Operations are immediately rejected without being executed. This prevents overloading the failing service.
23+ /// * **Half-Open:** After a timeout period, the circuit enters a half-open state, allowing a limited number of operations to be executed.
24+ /// If the probe succeeds, the circuit closes; otherwise, it returns to the open state.
2525///
2626/// By default, the circuit breaker is configured with the following:
2727///
28- /// * No retry attempt after a failure.
29- /// * A default reset timeout of 30 seconds.
30- /// * One retry attempt in half-open state.
31- /// * No delay between retries.
28+ /// * No retry attempt after a failure.
29+ /// * A default reset timeout of 30 seconds.
30+ /// * One retry attempt in half-open state.
31+ /// * No delay between retries.
3232///
3333/// # Configuration
3434///
3535/// The behavior of the circuit breaker can be customized using the following builder methods:
3636///
37- /// * [`CircuitBreaker::retries(self, max_retries: usize)`]: Sets the maximum number of consecutive failures allowed before the circuit opens.
38- /// A value of 0 means the circuit will open on the first failure.
39- /// * [`CircuitBreaker::half_open_max_failures(self, max_retries: usize)`]: Sets the maximum number of attempts in half-open state
40- /// before reopening the circuit.
41- /// * [`CircuitBreaker::reset_timeout(self, reset_timeout: Duration)`]: Sets the duration the circuit remains open after tripping.
42- /// After this timeout, the circuit transitions to the half-open state.
43- /// * [`CircuitBreaker::exponential_backoff(self, initial_delay: Duration)`]: Configures an exponential backoff strategy for retries.
44- /// The delay between retries increases exponentially. This overrides any previously set backoff.
45- /// * [`CircuitBreaker::constant_backoff(self, delay: Duration)`]: Configures a constant backoff strategy for retries.
46- /// The delay between retries remains constant. This overrides any previously set backoff.
37+ /// * [`CircuitBreaker::retries(self, max_retries: usize)`]: Sets the maximum number of consecutive failures allowed before the circuit opens.
38+ /// A value of 0 means the circuit will open on the first failure.
39+ /// * [`CircuitBreaker::half_open_max_failures(self, max_retries: usize)`]: Sets the maximum number of attempts in half-open state
40+ /// before reopening the circuit.
41+ /// * [`CircuitBreaker::reset_timeout(self, reset_timeout: Duration)`]: Sets the duration the circuit remains open after tripping.
42+ /// After this timeout, the circuit transitions to the half-open state.
43+ /// * [`CircuitBreaker::exponential_backoff(self, initial_delay: Duration)`]: Configures an exponential backoff strategy for retries.
44+ /// The delay between retries increases exponentially. This overrides any previously set backoff.
45+ /// * [`CircuitBreaker::constant_backoff(self, delay: Duration)`]: Configures a constant backoff strategy for retries.
46+ /// The delay between retries remains constant. This overrides any previously set backoff.
4747///
4848/// # Example
4949///
0 commit comments