Package

retry

Permalink

package retry

Visibility
  1. Public
  2. All

Type Members

  1. trait CountingPolicy extends Policy

    Permalink

    Retry policy that incorporates a count

  2. trait Jitter extends AnyRef

    Permalink
  3. trait Policy extends AnyRef

    Permalink

    A Policy defines an interface for applying a future with retry semantics specific to implementations

  4. case class PromiseWrapper[T](promise: () ⇒ Future[T]) extends Product with Serializable

    Permalink
  5. class Success[-T] extends AnyRef

    Permalink
    Annotations
    @implicitNotFound( ... )

Value Members

  1. object Backoff

    Permalink
  2. object Defaults

    Permalink
  3. object Directly

    Permalink
  4. object Jitter

    Permalink

    The algorithms here were inspired by this article: https://www.awsarchitectureblog.com/2015/03/backoff.html

  5. object JitterBackoff

    Permalink

    A retry policy which will back off using a configurable policy which incorporates random jitter.

    A retry policy which will back off using a configurable policy which incorporates random jitter. This has the advantage of reducing contention if you have threaded clients using the same service.

    val policy = retry.JitterBackoff()
    val future = policy(issueRequest)

    The following pre-made jitter algorithms are available for you to use:

    You can choose one like this:

    implicit val jitter = retry.Jitter.full(cap = 5.minutes)
    val policy = retry.JitterBackoff(1 second)
    val future = policy(issueRequest)

    If a jitter policy isn't in scope, it will use retry.Jitter.full by default which tends to cause clients slightly less work at the cost of slightly more time.

    For more information about the algorithms, see the following article:

    https://www.awsarchitectureblog.com/2015/03/backoff.html

  6. object Pause

    Permalink
  7. object PromiseWrapper extends Serializable

    Permalink
  8. object Success

    Permalink
  9. object When

    Permalink

    A retry policy in which the a failure determines the way a future should be retried.

    A retry policy in which the a failure determines the way a future should be retried. The partial function provided may define the domain of both the success OR exceptional failure of a future fails explicitly.

    val policy = retry.When {
      case RetryAfter(retryAt) => retry.Pause(delay = retryAt)
    }
    val future = policy(issueRequest)

    If the result is not defined for the depends block, the future will not be retried.

Ungrouped