RetryConfig

ox.resilience.RetryConfig
See theRetryConfig companion object
case class RetryConfig[E, T](schedule: Schedule, resultPolicy: ResultPolicy[E, T], onRetry: (Int, Either[E, T]) => Unit)

A config that defines how to retry a failed operation.

It is a special case of ScheduledConfig with ScheduledConfig.sleepMode always set to SleepMode.Delay

Type parameters

E

The error type of the operation. For operations returning a T or a Try[T], this is fixed to Throwable. For operations returning an Either[E, T], this can be any E.

T

The successful result type for the operation.

Value parameters

onRetry

A function that is invoked after each retry attempt. The callback receives the number of the current retry attempt (starting from 1) and the result of the operation that was attempted. The result is either a successful value or an error. The callback can be used to log information about the retry attempts, or to perform other side effects. By default, the callback does nothing.

resultPolicy

A policy that allows to customize when a non-erroneous result is considered successful and when an error is worth retrying (which allows for failing fast on certain errors). See ResultPolicy for more details.

schedule

The retry schedule which determines the maximum number of retries and the delay between subsequent attempts to execute the operation. See Schedule for more details.

Attributes

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

Members list

Value members

Concrete methods

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product