From 32b7af09018f0133c1839eca9b944b41ff78ad5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Wed, 3 Jan 2024 12:51:52 +0000 Subject: [PATCH] fix docs formatting --- README.md | 2 +- src/Stamina.hs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0206ab2..b4ee0b4 100644 --- a/README.md +++ b/README.md @@ -70,4 +70,4 @@ go2 = Stamina.retryFor Stamina.defaults handler $ \retryStatus -> do ```haskell main = undefined ``` - \ No newline at end of file + diff --git a/src/Stamina.hs b/src/Stamina.hs index 05e85f5..1032612 100644 --- a/src/Stamina.hs +++ b/src/Stamina.hs @@ -85,15 +85,19 @@ data RetryAction -- The backoff delays between retries grow exponentially plus a random jitter. -- The backoff for retry attempt number _attempt_ is computed as: -- +-- @ -- backoffExpBase ** (attempt - 1) + random(0, backoffJitter) +-- @ -- -- With the default values, the backoff for the first 5 attempts will be: -- +-- @ -- 2 ** 0 + random(0, 1) = 1 + random(0, 1) -- 2 ** 1 + random(0, 1) = 2 + random(0, 1) -- 2 ** 2 + random(0, 1) = 4 + random(0, 1) -- 2 ** 3 + random(0, 1) = 8 + random(0, 1) -- 2 ** 4 + random(0, 1) = 16 + random(0, 1) +-- @ -- -- If all retries fail, the last exception is let through. retry :: (MonadCatch m, MonadIO m) => RetrySettings -> (RetryStatus -> m a) -> m a