I'm a newbie in RxJava and I was doing some RESTful programming using RxJava2. I had few API calls to be made which were all independent with respect to each other. What I observed from my use case is that, since the API calls were being async wrt each other and were all returning Observables<String>
, and from all the API responses I was doing some computations, So at the time of computation, I didn't had responses from few APIs yet and as such it failed. For all those APIs whose response was not yet received, I was making use of subscribe
like the below code :
Observable<String> res = someApiCall(data1,data2);
res.subscribe(data -> { //Call Another Method.})
And for the ones for which response was received the code was :
return someApiCall.flatMap(data -> { // Call Another Method})
My Question is : Does using FlatMap makes it Blocking ? How does the 2 flows that i described above differ ? Is Subscribe always in async ?