Packages

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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Backoff
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(start: Duration)(f: (Duration) => Duration): Stream[Duration]

    Create infinite backoffs that start with start and change by f.

    Create infinite backoffs that start with start and change by f.

    Note

    This is an exact version of Stream.iterate.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def const(start: Duration): Stream[Duration]

    See constant for a Java friendly API

  8. def constant(start: Duration): Stream[Duration]

    Alias for const, which is a reserved word in Java

  9. 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 at maximum.

    Create infinite backoffs that have jitter with a random distribution between start and 3 times the previously selected value, capped at maximum.

    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.

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. 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.

  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def exponential(start: Duration, multiplier: Int, maximum: Duration): Stream[Duration]

    Create infinite backoffs that grow exponentially by multiplier, capped at maximum.

    Create infinite backoffs that grow exponentially by multiplier, capped at maximum.

    See also

    exponentialJittered for a version that incorporates jitter.

  14. 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.

  15. 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.

  16. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  17. 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.

  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def linear(start: Duration, offset: Duration, maximum: Duration): Stream[Duration]

    Create infinite backoffs that grow linear by offset, capped at maximum.

  22. def linear(start: Duration, offset: Duration): Stream[Duration]

    Create infinite backoffs that grow linear by offset.

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toJava(backoffs: Stream[Duration]): Callable[Iterator[Duration]]

    Convert a Stream of Durations into a Java-friendly representation.

  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped