Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Glue.Retry
Description
Module containing retry functionality, allowing the construction of services that attempt multiple times in case of transient failure.
Synopsis
- data RetryOptions a
- defaultRetryOptions :: RetryOptions a
- retryingService :: MonadBaseControl IO m => RetryOptions a -> BasicService m a b -> BasicService m a b
- retryAllowed :: RetryOptions a -> a -> Bool
- retryInitialWaitTimeMs :: RetryOptions a -> Int
- maximumRetries :: RetryOptions a -> Int
- retryWaitTimeMultiplier :: RetryOptions a -> Double
Documentation
data RetryOptions a Source #
Options for determining behaviour of retrying services.
defaultRetryOptions :: RetryOptions a Source #
Defaulted options for retrying 3 times with no wait time.
Arguments
:: MonadBaseControl IO m | |
=> RetryOptions a | Instance of |
-> BasicService m a b | The service to perform retries of. |
-> BasicService m a b |
Retries a call to a service multiple times, potentially backing off wait times between subsequent calls. | Asynchronous exceptions don't result in a retry, they are immediately rethrown.
retryAllowed :: RetryOptions a -> a -> Bool Source #
Predicate for determining if we can retry a call, can be used to prevent retries on non-idempotent operations.
retryInitialWaitTimeMs :: RetryOptions a -> Int Source #
Amount of time to wait after the first failure.
maximumRetries :: RetryOptions a -> Int Source #
The upper bound on how many attempts to make when invoking the service.
retryWaitTimeMultiplier :: RetryOptions a -> Double Source #
How much to multiply retryInitialWaitTimeMs
by for each number of times the service has retried.