I have a varying length of Observable array. I would like to zip the requests (i.e. make a bunch of API requests and wait until all of them finish), but I cannot figure out how to implement the zip function.
Observable.zip(observables, new FuncN<List<ResponseBody>>() {
@Override
public List<ResponseBody> call(Object... args) {
return Arrays.asList(args); <- compile error here
}
});
Here the obserables
is an array of List<Observable<ResponseBody>>
and its length is unknown apriori.
The parameter of call in zip function cannot be corrected to ResponseBody...
. How to make it return Observable<List<ResponseBody>>
?
Is it a constraint in the design of FuncN
RxJava 1.x.x?
P.S. I am using RxJava 1.1.6.
>
– yosriz Feb 23 '17 at 11:16