RetryContext

case
class RetryContext(context: Option[Any], lastError: Throwable, retryCount: Int, maxRetry: Int, retryWaitStrategy: RetryPolicy, nextWaitMillis: Int, baseWaitMillis: Int, extraWaitMillis: Int, resultClassifier: Any => ResultClass, errorClassifier: Throwable => Failed, beforeRetryAction: RetryContext => Any)
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def beforeRetry[U](handler: RetryContext => U): RetryContext
def canContinue: Boolean
def init(context: Option[Any]): RetryContext
def nextRetry(retryReason: Throwable): RetryContext

Update the retry context, including retry count, last error, next wait time, etc.

Update the retry context, including retry count, last error, next wait time, etc.

Returns

the next retry context

Clear the default beforeRetry action

Clear the default beforeRetry action

def retryOn(errorClassifier: PartialFunction[Throwable, Failed]): RetryContext

Add a partial function that accepts exceptions that need to be retried.

Add a partial function that accepts exceptions that need to be retried.

def run[A](body: => A): A
def runWithContext[A](context: Any)(body: => A): A
def withBackOff(initialIntervalMillis: Int, maxIntervalMillis: Int, multiplier: Double): RetryContext
def withErrorClassifier(errorClassifier: Throwable => Failed): RetryContext

Set a detailed error handler upon Exception. If the given exception is not retryable, just rethrow the exception. Otherwise, consume the exception.

Set a detailed error handler upon Exception. If the given exception is not retryable, just rethrow the exception. Otherwise, consume the exception.

def withJitter(initialIntervalMillis: Int, maxIntervalMillis: Int, multiplier: Double): RetryContext
def withMaxRetry(newMaxRetry: Int): RetryContext
def withResultClassifier[U](newResultClassifier: U => ResultClass): RetryContext
def withRetryWaitStrategy(newRetryWaitStrategy: RetryPolicy): RetryContext

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product