Observable<List<Stop>> zippedObservable = Observable.zip(observableList, objects -> {
List<Stop> stopList = Collections.emptyList();
for (Object obj : objects) {
stopList.add((Stop) obj);
}
return stopList;
});
I have the zippedObservable variable which was zipped by multiple observables.
disposable.add(zippedObservable.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new DisposableObserver<List<Stop>>() {
// onNext, onComplete, onError omitted
}));
This function emits the items (zipped stop list) successfully, but I'd like to emit these items every minute. I assumed that interval
operator would be perfect for this case, but I couldn't figure out how to mix both zip
and interval
functionalities.
This is what I tried
zippedObservale.interval() // cannot call interval operator here.
Observable.zip(...).interval() // cannot call interval operator here too.
I am looking for someone to explain how to mix these two operators so that I can emit the items every minute. Thank you.