Hello,
In my webapp, I have to chain two async calls :
The first call gives me a list of dog ids.
The second call gives me a Dog (found by its id).
In my code, i'd like to write something like :
final Observable<RxMessage<String>> observable1 = asyncCallForDogIds(..);
final List<Dog> dogs = new ArrayList<>();
observable1.subscribe(
// onNext
(RxMessage<String> message) -> {
final String id = readId(message);
final Observable<RxMessage<String>> observable2 = someAsyncCallForOneDogId(id, ..);
final Dog dog = readFromSomeMessage2(...);
dogs.add(dog);
},
// onError
(Throwable err) -> error(err, ..),
// onCompleted
() -> resume(dogs, ..));
What would be the best way to do that ?
Th.
Hello,
In my webapp, I have to chain two async calls :
The first call gives me a list of dog ids.
The second call gives me a Dog (found by its id).
In my code, i'd like to write something like :
What would be the best way to do that ?
Th.