retry library
Retry asynchronous functions with exponential backoff.
For a simple solution see retry, to modify and persist retry options see RetryOptions. Note, in many cases the added configurability is unnecessary and using retry is perfectly fine.
Classes
- RetryOptions
- Object holding options for retrying a function.
Functions
-
retry<
T> (FutureOr< T> fn(), {Duration delayFactor = const Duration(milliseconds: 200), double randomizationFactor = 0.25, Duration maxDelay = const Duration(seconds: 30), int maxAttempts = 8, FutureOr<bool> retryIf(Exception)?, FutureOr<void> onRetry(Exception)?}) → Future<T> -
Call
fn
retrying so long asretryIf
returntrue
for the exception thrown, up-tomaxAttempts
times.