Stamina: Retrying for humans using Haskell

A library for retrying in Haskell has been brewing in my mind for a few years now, based on everything we’ve learned so far at. Yesterday @hynek nerd-snipped me into sketching it out based on his design.

Here’s the proposed API/Example:

Feedback welcome at the concept stage!

11 Likes

Hello, nice library name :slight_smile:

Could you please list the differences with the existing retry library? In particular, how to handle rate limit where the delay is defined in the server response (e.g. with retry we would use the ConsultPolicyOverrideDelay RetryAction).

8 Likes

Most likely (if retry offers all required features) it would be the implementation detail, since I’m not looking at re-implementing the retrying logic itself, but rather want a simple interface.

Server limited response can be done using RetryAfter Int, which will be used in Stamina.HTTP.

1 Like

https://blog.cachix.org/posts/2024-01-02-stamina-haskell-library-for-retries/

6 Likes

This looks nice! I can see myself reaching for it instead of retry in some common cases, and then reaching for retry other times as well. More than one way to do it is one of my favorite parts of the Haskell community :grin: