Polling Config Builder
Builder Pattern for creating PollingConfig in a fluent, readable way. Keeps compatibility by producing the existing PollingConfig
Functions
Sets the backoff policy controlling delays, jitter, attempts, and timeouts.
Sets the CoroutineDispatcher used to run polling. Defaults to Dispatchers.Default.
Sets the suspending fetch operation that produces a PollingResult
Hook invoked once with the terminal outcome, total attempts, and elapsed time.
Hook invoked after each attempt completes with a result (Success/Waiting/Failure/Unknown/Cancelled).
Sets the retry predicate used when the last attempt produced a Failure(Error). Return true to retry, false to stop with Exhausted. See built-ins in RetryPredicates.
Sets a mapper to convert thrown exceptions into domain Error values. Defaults to a mapper that uses code=-1 and Throwable.message/class name.