AutoReconnectConfig

data class AutoReconnectConfig(val enabled: Boolean = true, val initialBackoff: Duration = 1.seconds, val maxBackoff: Duration = 60.seconds, val maxAttempts: Int? = null, val backoffMultiplier: Double = 2.0, val jitter: Double = 0.2)(source)

Tunables for the engine's built-in auto-reconnect supervisor.

Configure on the RadioClient.Builder via autoReconnect(...).

Default: Disabled. The 1.0 release will flip the default to enabled = true; pin a value explicitly here if you want today's "host owns reconnect policy" behaviour to survive that bump.

Backoff formula: delay(n) = min(initialBackoff * backoffMultiplier^(n-1), maxBackoff) then multiplied by (1 ± jitter * random()). The supervisor uses kotlinx.coroutines.delay so virtual-time test runners (runTest / advanceTimeBy) drive the schedule deterministically.

Since

0.1.0

Constructors

Link copied to clipboard
constructor(enabled: Boolean = true, initialBackoff: Duration = 1.seconds, maxBackoff: Duration = 60.seconds, maxAttempts: Int? = null, backoffMultiplier: Double = 2.0, jitter: Double = 0.2)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

exponential growth factor between attempts (default: 2.0). Coerced to >= 1.0 by the init block.

Link copied to clipboard

toggle the supervisor entirely. When false the engine surfaces a single ConnectionState.Disconnected after a transport drop.

Link copied to clipboard

delay before the first reconnect attempt (default: 1 s).

Link copied to clipboard

symmetric multiplicative randomization, in 0.0..1.0. 0.2 means ±20% on each computed delay. 0.0 disables jitter entirely.

Link copied to clipboard

upper bound on reconnect attempts; null means retry indefinitely. When the cap is reached the engine emits ConnectionState.Disconnected with the original cause and stops.

Link copied to clipboard

hard cap on backoff between successive attempts (default: 60 s).