RetryContext

wvlet.airframe.control.Retry.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)

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

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.

Attributes

Returns

the next retry context

Clear the default beforeRetry action

Clear the default beforeRetry action

Attributes

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.

Attributes

def run[A](body: => A): A
def runAsyncWithContext[A](context: Any, circuitBreaker: CircuitBreaker)(body: => Rx[A]): Rx[A]
def runWithContext[A](context: Any, circuitBreaker: CircuitBreaker)(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.

Attributes

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]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product