Retry given action up to 10 times, using the provided reporting function to signal retries. Initial retry interval is 100 milliseconds, after that it doubles with each iteration, with a maximum of 5 seconds.
Modulekes-agent-1.3.0.0Haskell2010
Cardano.KESAgent.Util.RetrySocket
Retry socket actions upon errors.
- 4 values
- Packagekes-agent-1.3.0.0
- Exports4
- LanguageHaskell2010
- LicenceApache-2.0
- SourceRetrySocket.hs
Null reporter for retry attempts (don't actually report anything)
Report retry attempts on stderr.
value
retrySocketWith :: (MonadCatch m, MonadDelay m, Exception e)=> (Int -> Int)Current interval to next interval (useful for implementing linearly or exponentially increasing intervals)
-> IntInterval between current attempt and next attempt
-> IntRemaining number of retries. 0 means the current attempt is the last one.
-> (e -> Int -> Int -> m ())Reporting function. Arguments: - exception that caused the failure - remaining number of retries - delay, in microseconds, until the next retry
-> m aThe action to (re-)try
-> m a
Retry socket action according to given parameters.