rx java - Hystrix command as rxJava2 Single


Keywords:rx  java 


Question: 

Is there a way to convert an HystrixCommand so it is used as a rxJava2's Single object? The main goal of that is calling multiple HystrixCommands in parallel and wait for all of them to finish (like rxJava2's merge method).

Thanks in advance!


1 Answer: 

You can get rxJava Observable from HystrixCommand.toObservable() and use RxJava2Interop to convert it to rxJava2 Observable and then single. Currently Hystrix doesn't use rxJava2.