HttpRetryOptions

@Serializable
data class HttpRetryOptions(val attempts: Int? = null, val initialDelay: Double? = null, val maxDelay: Double? = null, val expBase: Double? = null, val jitter: Double? = null, val httpStatusCodes: List<Int>? = null)

HTTP retry options to be used in each of the requests.

Constructors

Link copied to clipboard
constructor(attempts: Int? = null, initialDelay: Double? = null, maxDelay: Double? = null, expBase: Double? = null, jitter: Double? = null, httpStatusCodes: List<Int>? = null)

Properties

Link copied to clipboard
val attempts: Int? = null

Maximum number of attempts, including the original request. If 0 or 1, it means no retries. If not specified, default to 5.

Link copied to clipboard
val expBase: Double? = null

Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.

Link copied to clipboard
val httpStatusCodes: List<Int>? = null

List of HTTP status codes that should trigger a retry. If not specified, a default set of retryable codes (408, 429, and 5xx) may be used.

Link copied to clipboard
val initialDelay: Double? = null

Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.

Link copied to clipboard
val jitter: Double? = null

Randomness factor for the delay. If not specified, default to 1.0.

Link copied to clipboard
val maxDelay: Double? = null

Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.