object Backoff
Implements various backoff strategies.
Strategies are defined by a Stream[Duration]
and are intended for use with
RetryFilter.apply and RetryPolicy.backoff to determine the duration after which a request
is to be retried.
- Note
All backoffs created by factory methods on this object are infinite. Use
Stream.take
to make them terminate.
- Alphabetic
- By Inheritance
- Backoff
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(start: Duration)(f: (Duration) => Duration): Stream[Duration]
Create infinite backoffs that start with
start
and change byf
.Create infinite backoffs that start with
start
and change byf
.- Note
This is an exact version of Stream.iterate.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def const(start: Duration): Stream[Duration]
See constant for a Java friendly API
- def constant(start: Duration): Stream[Duration]
Alias for const, which is a reserved word in Java
- def decorrelatedJittered(start: Duration, maximum: Duration): Stream[Duration]
Create infinite backoffs that have jitter with a random distribution between
start
and 3 times the previously selected value, capped atmaximum
.Create infinite backoffs that have jitter with a random distribution between
start
and 3 times the previously selected value, capped atmaximum
.- start
must be greater than 0 and less than or equal to
maximum
.- maximum
must be greater than 0 and greater than or equal to
start
.
- See also
exponentialJittered and equalJittered for alternative jittered approaches.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equalJittered(start: Duration, maximum: Duration): Stream[Duration]
Create infinite backoffs that keep half of the exponential growth, and jitter between 0 and that amount.
Create infinite backoffs that keep half of the exponential growth, and jitter between 0 and that amount.
- See also
exponentialJittered and decorrelatedJittered for alternative jittered approaches.
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exponential(start: Duration, multiplier: Int, maximum: Duration): Stream[Duration]
Create infinite backoffs that grow exponentially by
multiplier
, capped atmaximum
.Create infinite backoffs that grow exponentially by
multiplier
, capped atmaximum
.- See also
exponentialJittered for a version that incorporates jitter.
- def exponential(start: Duration, multiplier: Int): Stream[Duration]
Create infinite backoffs that grow exponentially by
multiplier
.Create infinite backoffs that grow exponentially by
multiplier
.- See also
exponentialJittered for a version that incorporates jitter.
- def exponentialJittered(start: Duration, maximum: Duration): Stream[Duration]
Create infinite backoffs that grow exponentially by 2, capped at
maximum
, with each backoff having jitter, or randomness, between 0 and the exponential backoff value.Create infinite backoffs that grow exponentially by 2, capped at
maximum
, with each backoff having jitter, or randomness, between 0 and the exponential backoff value.- start
must be greater than 0 and less than or equal to
maximum
.- maximum
must be greater than 0 and greater than or equal to
start
.
- See also
decorrelatedJittered and equalJittered for alternative jittered approaches.
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromFunction(f: () => Duration): Stream[Duration]
Create infinite backoffs with values produced by a given generation function.
Create infinite backoffs with values produced by a given generation function.
- Note
This is an exact version of Stream.continually.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def linear(start: Duration, offset: Duration, maximum: Duration): Stream[Duration]
Create infinite backoffs that grow linear by
offset
, capped atmaximum
. - def linear(start: Duration, offset: Duration): Stream[Duration]
Create infinite backoffs that grow linear by
offset
. - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toJava(backoffs: Stream[Duration]): Callable[Iterator[Duration]]
Convert a Stream of Durations into a Java-friendly representation.
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()