Package-level declarations

Types

Link copied to clipboard

Predefined BackoffPolicy configurations for common scenarios.

Link copied to clipboard
data class BackoffPolicy(val initialDelayMs: Long = 500, val maxDelayMs: Long, val multiplier: Double = 2.0, val jitterRatio: Double = 0.2, val maxAttempts: Int = 8, val overallTimeoutMs: Long, val perAttemptTimeoutMs: Long? = null, val random: Random = Random.Default)

Configuration for exponential backoff with optional jitter.

Link copied to clipboard

Public facade instance for consumers. Delegates to the internal engine.

Link copied to clipboard
interface PollingApi

Public abstraction layer for consumers. Exposes a small, stable API surface. Internals are delegated to the PollingEngine implementation.

Link copied to clipboard
data class PollingConfig<T>(val fetch: suspend () -> PollingResult<T>, val isTerminalSuccess: (T) -> Boolean, val shouldRetryOnError: (Error?) -> Boolean = { true }, val backoff: BackoffPolicy = BackoffPolicy(), val dispatcher: CoroutineDispatcher = Dispatchers.Default, val onAttempt: (attempt: Int, delayMs: Long?) -> Unit = { _, _ -> }, val onResult: (attempt: Int, result: PollingResult<T>) -> Unit = { _, _ -> }, val onComplete: (attempts: Int, durationMs: Long, outcome: PollingOutcome<T>) -> Unit = { _, _, _ -> }, val throwableMapper: (Throwable) -> Error = { t -> val msg = t.message ?: (t::class.simpleName ?: "Throwable") // Use a stable public default code without exposing internal ErrorCodes Error(-1, msg) })

Configuration for the polling engine.

Link copied to clipboard
sealed class PollingOutcome<out T>

Terminal outcome of a polling session.

Link copied to clipboard
data class PollingSession(val id: String)

Represents a running polling session created by the SDK.

Link copied to clipboard

Common retry strategies for polling. Use these to avoid boilerplate and ensure consistency.