Target filter
Search Kotlin docs
  • Back
  • Tealium Prism Kotlin SDK Reference
core/com.tealium.prism.core.api.network/RequestInterceptors

RequestInterceptors

object RequestInterceptors

Utility object for getting the built-in RequestInterceptors, to add to a client derived with NetworkClient.newClient.

See also

RequestInterceptor

Functions

retryWhenConnected
Link copied to clipboard
@JvmStatic
fun retryWhenConnected(connectivity: Connectivity): RequestInterceptor

Creates an interceptor that, while the device is not connected, retries a retryable failure (see NetworkException.isRetryable) once connectivity returns.

retryWithBackoff
Link copied to clipboard
@JvmStatic
@JvmOverloads
fun retryWithBackoff(maxAttempts: Int? = 3, transientBaseDelay: TimeFrame = 100.milliseconds, throttlingBaseDelay: TimeFrame = 1.seconds, maxDelay: TimeFrame = 20.seconds, retryAfterAboveMaxDelay: RetryAfterAboveMaxDelay = RetryAfterAboveMaxDelay.GIVE_UP): RequestInterceptor

Creates an interceptor that retries retryable failures (see NetworkException.isRetryable), for example HTTP 429 and 503 or a lost connection, with a full-jitter exponential backoff, and decides when to give up.

Generated by Dokka
(c) Tealium 2026