RetryPolicy

class RetryPolicy @InternalWowApi constructor(val maxAttempts: Int = HandlerRetry.DEFAULT_MAX_ATTEMPTS, val initialBackoff: Duration = 100.milliseconds, val maxBackoff: Duration = 5.seconds, val multiplier: Double = 2.0, val timeout: Duration = Duration.INFINITE)

How a failing call is retried: at most maxAttempts calls in all, waiting initialBackoff after the first failure and multiplier times longer after each next one, never longer than maxBackoff. A handler's attempt that runs longer than timeout is cancelled and counts as failed; infinite by default.

Constructors

Link copied to clipboard
constructor(maxAttempts: Int = HandlerRetry.DEFAULT_MAX_ATTEMPTS, initialBackoff: Duration = 100.milliseconds, maxBackoff: Duration = 5.seconds, multiplier: Double = 2.0, timeout: Duration = Duration.INFINITE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun backoff(failures: Int): Duration

The wait after failures failed calls (1 for the first).

Link copied to clipboard
fun copyWith(maxAttempts: Int = this.maxAttempts, initialBackoff: Duration = this.initialBackoff, maxBackoff: Duration = this.maxBackoff, multiplier: Double = this.multiplier, timeout: Duration = this.timeout): RetryPolicy

This RetryPolicy with the given fields replaced: Wow's own copy, left out of the ABI.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

This policy with the settings retry gives in place of its own. An initial backoff longer than this policy's maximum raises the maximum to it, unless retry gives the maximum too.