RetryPolicy

data class RetryPolicy(val maxRetries: Int = 3, val baseDelayMillis: Long = 500, val maxDelayMillis: Long, val backoffMultiplier: Double = 2.0, val jitterMillis: Long = 0, val retryStatusCodes: Set<Int> = setOf(429, 500, 502, 503, 504), val respectRetryAfterHeader: Boolean = true)

Constructors

Link copied to clipboard
constructor(maxRetries: Int = 3, baseDelayMillis: Long = 500, maxDelayMillis: Long, backoffMultiplier: Double = 2.0, jitterMillis: Long = 0, retryStatusCodes: Set<Int> = setOf(429, 500, 502, 503, 504), respectRetryAfterHeader: Boolean = true)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val maxRetries: Int = 3
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun backoffDelayMillis(retryAttempt: Int): Long

Executes backoffDelayMillis.

Link copied to clipboard
fun shouldRetry(statusCode: Int): Boolean

Executes shouldRetry.