BackOff

class BackOff

Implementation of BackOff that increases the back off period for each retry attempt.

Types

Link copied to clipboard
enum BackoffError : Enum<BackOff.BackoffError>
Link copied to clipboard
data class Builder(    maxAttempts: Int,     baseDelay: Long = DEFAULT_BASE_DELAY,     maxBackoffTime: Long = DEFAULT_MAX_BACKOFF_IN_MILLISECONDS,     enableJitter: Boolean = true)

Builder class for BackOff

Link copied to clipboard
object Companion
Link copied to clipboard
interface Observer

Functions

Link copied to clipboard
fun awaitRetry(code: Status.Code, observer: BackOff.Observer)

Wait for Retry

Link copied to clipboard
fun duration(): Long

Returns the duration (milliseconds).

Link copied to clipboard
fun reset()

clean up

Link copied to clipboard
fun shutdown()

Properties

Link copied to clipboard
var attempts: Int = 0

The current retry count.