glue-0.2.0: Make better services.

Safe HaskellNone
LanguageHaskell2010

Glue.Failover

Description

Module supporting failover of a service by transforming the request each time a failure occurs up to a fixed number of attempts.

Synopsis

Documentation

data FailoverOptions a Source

Options for determining behaviour of failover services.

defaultFailoverOptions :: FailoverOptions a Source

Simple defaults that results in retrying 3 times in a dumb way immediately without transforming the request.

failover Source

Arguments

:: MonadBaseControl IO m 
=> FailoverOptions a

Instance of FailoverOptions to configure the failover functionality.

-> BasicService m a b

The service to perform failover around.

-> BasicService m a b 

Creates a service that can transform requests with each subsequent failure.

maxFailovers :: FailoverOptions a -> Int Source

The maximum numer of times the service will failover and make another attempt.

transformFailoverRequest :: FailoverOptions a -> a -> a Source

Each time the service performs a failover, transform the request with this function.