RetryStrategy

data class RetryStrategy(val maxRetries: Int = 3, val base: Double = 2.0, val maxDelay: Duration = 60.seconds, val retryOnStatusCodes: Set<Int> = setOf(429, 502, 503, 504))(source)

Specifies the retry strategy for failed requests.

Uses exponential backoff with configurable base and maximum delay.

Throws

if validation fails

Constructors

Link copied to clipboard
constructor(maxRetries: Int = 3, base: Double = 2.0, maxDelay: Duration = 60.seconds, retryOnStatusCodes: Set<Int> = setOf(429, 502, 503, 504))

Properties

Link copied to clipboard

The base value for exponential backoff calculation (must be > 0)

Link copied to clipboard

The maximum delay between retry attempts (must be positive)

Link copied to clipboard

The maximum number of retries to perform for a request (must be >= 0)

Link copied to clipboard

HTTP status codes that should trigger a retry (default: 429, 502, 503, 504)