How to combine multiple RxJava chains non-blocking in error case

后端 未结 5 1455
旧巷少年郎
旧巷少年郎 2020-12-15 10:19

My requirements:

  • N Retrofit calls in parallel
  • Wait for all calls to finish (success or failure)
  • If k (0<= k < N) calls fail, they sho
5条回答
  •  佛祖请我去吃肉
    2020-12-15 11:06

    You can use Observable.mergeDelayError(api1Call, api2Call, api3Call).

    Bonus: You can also specify how many maximum parallels calls can be run at the same time. For example:

    Observable .mergeDelayError(Observable.from(api1Call, api2Call, api3Call), 5).

提交回复
热议问题