Retry service provides policy for how often some operation should happen with the timeout limit and delay between events
The service creates sequence of the delays (nanoseconds) according to chosen strategy
There are two strategies
type
description
constant
The strategy implements constant backoff
exponential [default]
Exponential backoff is a strategy in which you increase the delays between retries
/// Constant delay between retries
case constant(
retry : UInt = 5,
duration: DispatchTimeInterval,
timeout: DispatchTimeInterval
)
/// Exponential backoff is a strategy in which you increase the delays between retries
case exponential(
retry : UInt = 3,
multiplier: Double = 2.0, // power exponent
duration: DispatchTimeInterval,
timeout: DispatchTimeInterval
)
Exponential backoff with jitter. Jitter adds some amount of randomness to the backoff to spread the retries around in time.
For more information Exponential Backoff And Jitter
Retry service provides policy for how often some operation should happen with the timeout limit and delay between events
The service creates sequence of the delays (nanoseconds) according to chosen strategy
There are two strategies
Packages using the package
Async http client
How to use
SwiftUI example for the package
example for retry service
TODO:
Exponential backoff with jitter. Jitter adds some amount of randomness to the backoff to spread the retries around in time. For more information Exponential Backoff And Jitter