O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

subscribeOn

The .subscribeOn() modifies the Scheduler (thread) where the source Observable is supposed to emit items. Basically, it modifies the thread where all the data handling starts.

Let's say that we've created an Observable with Observable.just(), and we subscribe to it. The subscription flow looks like the one specified in the following figure (let's use it as a baseline):

If .subscribeOn() is called, it will change the execution thread for the entire chain, as in the following figure:

It is also useful to note that multiple calls to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required