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 and ObserveOn

The .subscribeOn() operator changes the scheduler where the Observer will start the execution, while the .observeOn() operator changes the scheduler where the actions will be executed after it is applied. The following .subscribeOn() action shows how it changed the scheduler for the entire Observable from the default one to the orange one; we can see this because the color of Observable lines and the color of dotted emission lines changed to orange:

The following diagram is a bit more complicated:

The first .observeOn() ...

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