Packages

object Schedules

Convenience methods to create common ZIO schedules for retrying

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

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. def common(min: zio.Duration = 1.second, max: zio.Duration = 1.minute, factor: Double = 2.0, retryImmediately: Boolean = true, maxRetries: Option[Int] = Some(3), jitterFactor: Double = 0.1): Schedule[Any, Any, (Any, Long)]

    A common-practice schedule for retrying

    A common-practice schedule for retrying

    By default the first retry is done immediately. With transient / random failures this method gives the highest chance of fast success. After that Retry uses exponential backoff between some minimum and maximum duration. Jitter is added to prevent spikes of retries from multiple instances. An optional maximum number of retries ensures that retrying does not continue forever.

    See also https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/

    min

    Minimum retry backoff delay

    max

    Maximum backoff time. When this value is reached, subsequent intervals will be equal to this value.

    factor

    Factor with which delays increase

    retryImmediately

    Retry immediately after the first failure

    maxRetries

    Maximum number of retries

    jitterFactor

    Maximum fraction of the current delay interval that is randomly added or subtracted. This helps to spread call attempts in time when there are multiple systems making calls to some system using the same retry schedule. For example, with jitterFactor = 0.1 the retry intervals will be multiplied with a random factor between 0.9 and 1.1. jitterFactor = 0 disables jittering.

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def exponentialBackoff[E](min: zio.Duration, max: zio.Duration, factor: Double = 2.0): Schedule[Any, E, zio.Duration]

    Schedule for exponential backoff up to a maximum interval

    Schedule for exponential backoff up to a maximum interval

    E

    Schedule input

    min

    Minimum backoff time

    max

    Maximum backoff time. When this value is reached, subsequent intervals will be equal to this value.

    factor

    Exponential factor. 2 means doubling, 1 is constant, < 1 means decreasing

  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. def whenCase[Env, In, Out](pf: PartialFunction[In, Any])(schedule: Schedule[Env, In, Out]): Schedule[Env, In, (In, Out)]

    Apply the given schedule only when inputs match the partial function

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped