RetryConfig
A config that defines how to retry failing operations.
Schedule provides the interval between subsequent invocations, which guarantees that the next operation will start no sooner than the specified duration after the previous operations has finished.
It is a special case of ScheduledConfig with ScheduledConfig.sleepMode always set to SleepMode.EndToStart
Type parameters
- E
-
The error type of the operation. For operations returning a
T
or aTry[T]
, this is fixed toThrowable
. For operations returning anEither[E, T]
, this can be anyE
. - T
-
The successful result type for the operation.
Value parameters
- afterAttempt
-
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. It will always be invoked at least once (for a successful operation run). 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 schedule which determines the intervals between invocations and number of attempts to execute the operation.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any