ANN: retry 0.1 - retry combinators for monadic actions that often fail

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ANN: retry 0.1 - retry combinators for monadic actions that often fail

ozataman
Dear Cafe,

I'm happy to announce the availability of the retry package on Hackage[1] and Github[2]. The package provides a few useful combinators for monadic actions that often fail and should be retried in cases of a certain set of exceptions (or failure modes). Such cases are quite common when querying databases (e.g. ResponseTimeout) or uploading files (e.g. socket closed), particularly in busy production systems.

The library exposes 'retrying' for failures encoded explicitly in the type and 'recovering' for failures through exceptions, respectively. You can choose either an "exponential back off" series of delays or a simple static delay between retries. In either case, there is a ceiling for the number of total retries. The haddocks provide further documentation and a few examples.

This library simply wraps around the given actions and does not really do anything fancy or unexpected. Nevertheless, the widespread applicability of this functionality justified a generic package to address the need centrally.

Suggestions and bug reports are most welcome.


Cheers,
Ozgun

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANN: retry 0.1 - retry combinators for monadic actions that often fail

Simon Marechal
On 13/03/2013 05:14, Ozgun Ataman wrote:
> In either case, there is a ceiling for the number of total retries.

This is something that I might want to use in many places. Is it
possible to have an infinite number of retries, instead of specifying
impossibly large values ?

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANN: retry 0.1 - retry combinators for monadic actions that often fail

ozataman
Good point - I'll put an option in for the next release.

On Wednesday, March 13, 2013 at 4:32 AM, Simon Marechal wrote:

On 13/03/2013 05:14, Ozgun Ataman wrote:
In either case, there is a ceiling for the number of total retries.

This is something that I might want to use in many places. Is it
possible to have an infinite number of retries, instead of specifying
impossibly large values ?

_______________________________________________
Haskell-Cafe mailing list


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe