News for hackers. Stuff that matters.
Re:Failsafe – failure handling with retries, circuit breaker... by cpitman on Saturday July 23, 2016 @11:12PM (#12152065)
How is this distinct from Hystrix (https://github.com/Netflix/Hystrix)? Why should I use one over the other?
Re:Failsafe – failure handling with retries, circuit breaker... by jodah on Saturday July 23, 2016 @11:23PM (#12152092)
Good question. Someone asked that recently on Github - here's a quick comparison:

https://github.com/jhalterman/failsafe/wiki/Comparisons#fail...

Re:Failsafe – failure handling with retries, circuit breaker... by vikiomega9 on Sunday July 24, 2016 @01:12AM (#12152296)
Is there a more detailed comparison?

For example,

>Executable logic can be passed through Failsafe as simple lambda expressions or method references. In Hystrix, your executable logic needs to be placed in a HystrixCommand implementation

It's not apparent to me what the advantage of either interface is. In both situations I have to define a "lambda" and hold state somewhere(either as an object field or passed into the lambda). Unless I'm something here, either seems acceptable.

Re:Failsafe – failure handling with retries, circuit breaker... by jodah on Sunday July 24, 2016 @01:50AM (#12152362)
> Is there a more detailed comparison?

There's nothing more detailed that I know of. Is there a particular feature area/comparison you're curious about? I can add a bit more detail.

> It's not apparent to me what the advantage of either interface is. In both situations I have to define a "lambda"

What I meant by this bit is that the user experience is different. Failsafe can be used with method references or lambda expressions [1], which are a nice, concise way of wrapping executable logic with some failure handling strategy. You cannot do this with Hystrix since all logic must be wrapped in a HystrixCommand impl, which cannot be implemented as a lambda.

> either seems acceptable.

Like anything, it just depends on what you want. If retries and general purpose failure handling, consider Failsafe. If request collapsing, thread pool management and monitoring, consider Hystrix.

[1]: https://github.com/jhalterman/failsafe#synchronous-retries

Re:Failsafe – failure handling with retries, circuit breaker... by vikiomega9 on Sunday July 24, 2016 @07:34PM (#12155494)
I'm curious about design in general. Circuit breaking and timeouts should be a well defined semantic of the caller and so my thoughts were more, how one could compose their code and bolt on failsafe, for example, but also quickly switch out to some other library.