Companion

object Companion

Properties

Link copied to clipboard
const val DEFAULT_MAX_ATTEMPTS: Int = 10

Default value for maxAttempts when not specified.

Link copied to clipboard

Maximum delay produced by Exponential.delayFor. Capped at 5 hours so iOS emulation does not park earliestBeginDate beyond a practical horizon.

Link copied to clipboard
const val MAX_MAX_ATTEMPTS: Int = 30

Upper bound for maxAttempts.

Link copied to clipboard

Minimum allowed initialDelay — matches Android WorkManager's MIN_BACKOFF_MILLIS (10 seconds) to keep cross-platform behavior identical.

Functions

Link copied to clipboard
@ObjCName(swiftName = "exponential")
fun exponential(initialDelay: Duration = 30.seconds, maxAttempts: Int = DEFAULT_MAX_ATTEMPTS): BackoffPolicy

Convenience factory for Exponential with the given parameters.

Link copied to clipboard
@ObjCName(swiftName = "linear")
fun linear(initialDelay: Duration = 30.seconds, maxAttempts: Int = DEFAULT_MAX_ATTEMPTS): BackoffPolicy

Convenience factory for Linear with the given parameters.