Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



> 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


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: