glue-core-0.4.4: Make better services and clients.

Safe HaskellNone
LanguageHaskell2010

Glue.Retry

Description

Module containing retry functionality, allowing the construction of services that attempt multiple times in case of transient failure.

Synopsis

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.

retryingService Source

Arguments

:: MonadBaseControl IO m 
=> RetryOptions a

Instance of RetryOptions to configure the retry functionality.

-> 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.

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.