Return your retrofit responses as Observable, then use the zip operator. http://reactivex.io/documentation/operators/zip.html
When one api call has dependency on the other api call, zip operator is the ideal since the Zip operator combines the emission of two observables in order.
Observable <String> feed = apiService.getFeed("param");
Observable <String> profile = apiService.getProfile("param");
Observable.zip(
feed, profile,
new Func2<String, String, ResultType>() {
@Override
public ResultType call(String feedResponse,
String profileResponse) {
// Do something with the feedResponse
// Do something with the profileResponse
// Return something with ResultType
return something;
}
}).subscribe(
//Once requests process are done
new Consumer<Object>() {
@Override
public void accept(Object o) throws Exception {
//on successful completion of the request
}
},
new Consumer<Throwable>() {
@Override
public void accept(Throwable e) throws Exception {
//on error
}
});