Linear

@Serializable
data class Linear(val initialDelay: Duration = 30.seconds, val maxAttempts: Int = DEFAULT_MAX_ATTEMPTS) : BackoffPolicy

Linear: delay = initialDelay × (attempt + 1). So delayFor(0) = initialDelay, delayFor(1) = 2 × initialDelay, delayFor(2) = 3 × initialDelay, …

attempt is 0-indexed, matching Android WorkManager's runAttemptCount (the count of prior failed runs).

Constructors

Link copied to clipboard
constructor(initialDelay: Duration = 30.seconds, maxAttempts: Int = DEFAULT_MAX_ATTEMPTS)

Properties

Link copied to clipboard
Link copied to clipboard
open override val maxAttempts: Int

Functions

Link copied to clipboard
open override fun delayFor(attempt: Int): Duration