Retrying the retry design
summary
Reimplements retry policies as a pure LazyList[FiniteDuration] instead of effectful RetryPolicy, showing a concrete Fibonacci backoff starting at 5ms, growing to 700ms, with each delay capped and a cumulative timeout of 5s. Rewrites Cats- and cats-retry-style code with two small changes to consume the LazyList, adds unit tests using Cat-Effect TestControl that run in ~38ms, and demonstrates the design simplifies testing and composes like ordinary collections.
AI-written summary · about
chapters (14)
- 0:00Retry design challenges
- 1:25Side-effect heavy retry APIs
- 3:09Immutable values and functions
- 4:38Testing complex retry strategy
- 7:31Testing side-effect APIs
- 9:15Signal versus noise in tests
- 12:47Separating retry concerns
- 13:50Ideal retry test design
- 15:14Redesigning retry policies
- 17:18Fibonacci backoff refactor
- 18:01Cumulative delay limits
- 18:43Where did the complexity go?
- 20:49Testing and API improvements
- 21:11Summary
related talks
28mLightweight Testing of Persistent Amortized Time Complexity in the Credit Monad
53mKleisli, a Friend Who Means You Well
28mAdopting Cats
31mPick a (Effect) Lane: A comparison of direct-style Scala vs effect systems
36mComposable concurrency with Ref + Deferred
30mTroll Driven Development: Implementing Functional Effects by Way of Self-Lobotomy
43mThe Design of the Scalaz 8 Effect System
32mEffective Programming in OCaml
