RetryPolicyOverride

class RetryPolicyOverride(val retryPolicy: RetryPolicy, val awaitReachabilityBeforeRequest: Boolean) : AbstractCoroutineContextElement

A coroutine context element that replaces NetworkClientConfiguration.retryPolicy for every NetworkClient request made while it is in the context. Install it with withRetryPolicy.

Use it when a caller runs its own retry loop around requests and must not have the client retry underneath it, which would multiply the attempts. MutationQueue uses it to make its retry policy the only one for its calls. It applies to everything inside the block, including child coroutines. ApiClient implementations other than NetworkClient may ignore it.

Constructors

Link copied to clipboard
constructor(retryPolicy: RetryPolicy, awaitReachabilityBeforeRequest: Boolean)
constructor(retryPolicy: RetryPolicy)

Creates an override that retains the normal connectivity wait only before client retries.

Types

Link copied to clipboard

Properties

Link copied to clipboard

whether to await the client's configured connectivity gate before the initial attempt, bounded by NetworkClientConfiguration.reachabilityWaitMillis. Useful when an outer retry loop owns retries but must preserve connectivity waiting.

Link copied to clipboard
open override val key: CoroutineContext.Key<*>
Link copied to clipboard

the policy used instead of the client's configured one.

Functions

Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext