I think another way of describing what my question here is that we have a call to auth(...) that returns an Observable<AuthResponse>. The call to subscribeOn is made on this returned object. So, how does subscribeOn execute a completed task - it has already returned a value - on a different thread?
Along the same lines, assuming the auth call was somehow moved to the IO thread, what does that say about the items in the chain after the subscribeOn call? What thread do they operate on (without any observeOn call)? The statement you made earlier is that subscribeOn affects all those items that appear before it in the chain, not after it. So this would put the auth call on the IO thread but not the subscribe call. So, why do we need the observeOn call?
And, to put the question into a larger context, I assume that the whole chain is invoked in a function that is being invoked on the UI thread. Otherwise the whole discussion of blocking the UI would be moot.
|