While using .observeOn() and .subscribeOn(), there are two rules of thumb:
- Place .subscribeOn() as early as possible in the flow of the Observable; this helps you to see which Scheduler the Subscription starts on
- Place .observeOn() just before .subscribe(); in cases where only a single .observeOn() is used, it helps you see on which Scheduler the .subscribe() action will be executed right away
Obviously, there will be lots of cases when they will be needed somewhere else in the chain or even having multiple calls to them will be necessary. However, it is recommended to start like this.
Finally, if there is no need for the .subscribeOn() and .observeOn() calls, they should be omitted.