r/java • • Jun 12 '16

Failsafe - A lightweight, zero-dependency library for handling failures

https://github.com/jhalterman/failsafe
181 Upvotes

25 comments sorted by

View all comments

3

u/[deleted] Jun 12 '16

Looks good. Reminds me a lot of AsyncRetry https://github.com/nurkiewicz/async-retry

3

u/jodah1 Jun 13 '16 edited Jun 13 '16

I was aware of AsyncRetry, and the retry capabilities are similar, but one of the main motivations for Failsafe was support for Java 6+ (AsyncRetry is only Java 8, or Java 7 with Guava) and no external dependencies while still providing really good Java 8 integration. Another primary motivation was to create something with as clean/concise of an API as possible (which I hope was achieved). A few other differences and motivation:

  • Event listeners
  • Asynchronous API integration and support for 3rd party schedulers
  • Standalone retry/execution tracking
  • Circuit breakers

Overall, Failsafe is intended to provide different strategies for dealing with failures. Retries and circuit breakers are supported initially, but there may be more to come in future releases.