So you have heard about RxJava, maybe checked out some articles, videos or even code - but things are still not that clear!?
The aim of this talk is first of all to create the reactive programming mindset; to explain what an Observable and a Subscriber are; and to give a bit of insight in the magic of thread handling in RxJava. We will then take a practical example, see how RxJava can be applied and what its advantages are compared to other options.
I will end the talk by addressing an important question: how to best proceed to integrate RxJava into an existing app.
68. 68
public Burger cook(){
// cooking is time consuming
// make sure it’s on a background thread
return burger;
}
Observable<Burger> burgerObservable =
Observable.fromCallable(this::cook)
.subscribeOn(Schedulers.computation())
.observeOn(AndroidSchedulers.mainThread())