Schedules
Convenience methods to create common ZIO schedules for retrying
Convenience methods to create common ZIO schedules for retrying
Value members
Concrete methods
A common-practice schedule for retrying
A common-practice schedule for retrying
By default the first retry is done immediately. With transient / random failures this method gives the highest chance of fast success. After that Retry uses exponential backoff between some minimum and maximum duration. Jitter is added to prevent spikes of retries. An optional maximum number of retries ensures that retrying does not continue forever.
See also https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
- Value Params
- factor
Factor with which delays increase
- jitterFactor
Maximum fraction of the current delay interval that is randomly added or substracted. This helps to spread call attempts in time. To get a 10% jitter for example, use jitterFactor=0.1
- max
Maximum backoff time. When this value is reached, subsequent intervals will be equal to this value.
- maxRetries
Maximum number of retries
- min
Minimum retry backoff delay
- retryImmediately
Retry immediately after the first failure
Schedule for exponential backoff up to a maximum interval
Schedule for exponential backoff up to a maximum interval
- Type Params
- E
Schedule input
- Value Params
- factor
Exponential factor. 2 means doubling, 1 is constant, < 1 means decreasing
- max
Maximum backoff time. When this value is reached, subsequent intervals will be equal to this value.
- min
Minimum backoff time
Apply the given schedule only when inputs match the partial function
Apply the given schedule only when inputs match the partial function