Thank you for your article, unfortunately there is something I didn’t understand about the usage of…
Eido Askayo
1

Hey Edio,
the issue you are having is quite frequent one. 
Let’s only focus on the first line:

Observable.just(this.method())

Because just as a parameter gets value and not function, we can rewrite the method like this:

boolean result = this.method();
Observable.just(result);

Not we can see that the this.method is executed before it has anything to do with Rx. This means that it will be executed on whatever thread the parent method is executed.

To execute the method in a thread specified by Rx, we need to use fromCallable:

Observable.fromCallable(() -> method())

or with method reference:


Observable.fromCallable(this::method)

This way method will be run on the thread you specify in onSubscribe.

Hope you get a clearer picture now.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.