Packages

case class RetryPolicy(maxRetries: Option[Int] = None, initialBackoff: FiniteDuration = FiniteDuration(1000, "ms"), maxBackoff: Option[FiniteDuration] = None, backoffMultiplier: Double = 1.0, jitter: FiniteDuration = FiniteDuration(0, "s"), minJitterThreshold: FiniteDuration = FiniteDuration(0, "s"), canRetry: (Throwable) => Boolean, name: String, recognizeServerRetryDelay: Boolean = false, maxServerRetryDelay: Option[FiniteDuration] = None) extends Product with Serializable

RetryPolicy configure the retry mechanism in GrpcRetryHandler

maxRetries

Maximum number of retries.

initialBackoff

Start value of the exponential backoff (ms).

maxBackoff

Maximal value of the exponential backoff (ms).

backoffMultiplier

Multiplicative base of the exponential backoff.

jitter

Sample a random value uniformly from the range [0, jitter] and add it to the backoff.

minJitterThreshold

Minimal value of the backoff to add random jitter.

canRetry

Function that determines whether a retry is to be performed in the event of an error.

name

Name of the policy.

recognizeServerRetryDelay

Per gRPC standard, the server can send error messages that contain RetryInfo message with retry_delay field indicating that the client should wait for at least retry_delay amount of time before retrying again, see: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L91 If this flag is set to true, RetryPolicy will use RetryInfo.retry_delay field in the backoff computation. Server's retry_delay can override client's maxBackoff. This flag does not change which errors are retried, only how the backoff is computed. DefaultPolicy additionally has a rule for retrying any error that contains RetryInfo.

maxServerRetryDelay

Limit for the server-provided retry_delay.

Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RetryPolicy
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RetryPolicy(maxRetries: Option[Int] = None, initialBackoff: FiniteDuration = FiniteDuration(1000, "ms"), maxBackoff: Option[FiniteDuration] = None, backoffMultiplier: Double = 1.0, jitter: FiniteDuration = FiniteDuration(0, "s"), minJitterThreshold: FiniteDuration = FiniteDuration(0, "s"), canRetry: (Throwable) => Boolean, name: String, recognizeServerRetryDelay: Boolean = false, maxServerRetryDelay: Option[FiniteDuration] = None)

    maxRetries

    Maximum number of retries.

    initialBackoff

    Start value of the exponential backoff (ms).

    maxBackoff

    Maximal value of the exponential backoff (ms).

    backoffMultiplier

    Multiplicative base of the exponential backoff.

    jitter

    Sample a random value uniformly from the range [0, jitter] and add it to the backoff.

    minJitterThreshold

    Minimal value of the backoff to add random jitter.

    canRetry

    Function that determines whether a retry is to be performed in the event of an error.

    name

    Name of the policy.

    recognizeServerRetryDelay

    Per gRPC standard, the server can send error messages that contain RetryInfo message with retry_delay field indicating that the client should wait for at least retry_delay amount of time before retrying again, see: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L91 If this flag is set to true, RetryPolicy will use RetryInfo.retry_delay field in the backoff computation. Server's retry_delay can override client's maxBackoff. This flag does not change which errors are retried, only how the backoff is computed. DefaultPolicy additionally has a rule for retrying any error that contains RetryInfo.

    maxServerRetryDelay

    Limit for the server-provided retry_delay.

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. val backoffMultiplier: Double
  6. val canRetry: (Throwable) => Boolean
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. def getName: String
  11. val initialBackoff: FiniteDuration
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. val jitter: FiniteDuration
  14. val maxBackoff: Option[FiniteDuration]
  15. val maxRetries: Option[Int]
  16. val maxServerRetryDelay: Option[FiniteDuration]
  17. val minJitterThreshold: FiniteDuration
  18. val name: String
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  22. def productElementNames: Iterator[String]
    Definition Classes
    Product
  23. val recognizeServerRetryDelay: Boolean
  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. def toState: RetryPolicyState
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

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

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped