HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

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
valueretrySocket
  1. :: (MonadCatch m, MonadDelay m, Exception e)
  2. => e -> Int -> Int -> m ()
  3. -> m a
  4. -> m a
#

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.

valueretrySocketWith
  1. :: (MonadCatch m, MonadDelay m, Exception e)
  2. => (Int -> Int)

    Current interval to next interval (useful for implementing linearly or exponentially increasing intervals)

  3. -> Int

    Interval between current attempt and next attempt

  4. -> Int

    Remaining number of retries. 0 means the current attempt is the last one.

  5. -> (e -> Int -> Int -> m ())

    Reporting function. Arguments: - exception that caused the failure - remaining number of retries - delay, in microseconds, until the next retry

  6. -> m a

    The action to (re-)try

  7. -> m a
#

Retry socket action according to given parameters.