retry 0.5 → 0.5.1
raw patch · 2 files changed
+13/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Retry: capDelay :: Int -> RetryPolicy -> RetryPolicy
Files
- retry.cabal +1/−1
- src/Control/Retry.hs +12/−0
retry.cabal view
@@ -14,7 +14,7 @@ case we should hang back for a bit and retry the query instead of simply raising an exception. -version: 0.5+version: 0.5.1 synopsis: Retry combinators for monadic actions that may fail license: BSD3 license-file: LICENSE
src/Control/Retry.hs view
@@ -40,6 +40,7 @@ , exponentialBackoff , fibonacciBackoff , limitRetries+ , capDelay -- * Re-export from Data.Monoid @@ -142,6 +143,17 @@ where fib 0 (a, _) = a fib !m (!a, !b) = fib (m-1) (b, a + b)+++-------------------------------------------------------------------------------+-- | Set an upperbound for any delays that may be directed by the+-- given policy.+capDelay+ :: Int+ -- ^ A maximum delay in microseconds+ -> RetryPolicy+ -> RetryPolicy+capDelay limit p = RetryPolicy $ \ n -> min limit `fmap` (getRetryPolicy p) n -------------------------------------------------------------------------------