retry library

Classes

CircuitBreaker
A circuit breaker that prevents repeated calls to a failing service.

Enums

CircuitState
Circuit breaker states.

Functions

retry<T>(Future<T> fn(), {int maxAttempts = 3, Duration delay = const Duration(seconds: 1), double backoffMultiplier = 2.0, bool jitter = true, bool retryIf(Exception)?, Duration? timeout, void onRetry(int attempt, Object error, Duration delay)?}) Future<T>
Retry an async operation with configurable backoff.
retryWithBackoff<T>(Future<T> fn(), {int maxAttempts = 5, void onRetry(int attempt, Object error, Duration delay)?}) Future<T>
Retry with pre-configured exponential backoff defaults.

Exceptions / Errors

CircuitBreakerOpenException
Thrown when attempting to execute through an open circuit.