retry library

Classes

RetryConfig
Recommended defaults: 4 attempts, 100ms initial, 30s max, full jitter, retry on the four transient codes above. Override individual fields via the named parameters.

Enums

RetryStrategy
Jitter scheme for retry delays.

Constants

defaultRetryableCodes → const Set<Code>
Retryable status codes per RFC 0006. Exposed for callers building a custom RetryConfig.isRetryable predicate that delegates to the default set.

Functions

defaultJitterSource() double
Cryptographically-secure uniform draw in [0.0, 1.0). Uses Random.secure(), which is backed by the platform CSPRNG (/dev/urandom, BCryptGenRandom, or Window.crypto.getRandomValues). Acceptable under FIPS 140-3 on platforms whose CSPRNG is validated.
retryHintFrom(ConnectException error) Duration?
Returns the server-supplied retry delay, or null if neither a RetryInfo detail nor a parseable retry-after header is present.
retryInterceptor([RetryConfig config = const RetryConfig()]) → Interceptor
Builds a Connect Interceptor that retries failed unary calls per RetryConfig. Without arguments, uses RFC 0006 defaults.