RxJava is Java implementation of Reactive Extension. Basically it’s a library that composes asynchronous events by following Observer Pattern. You can create asynchronous data stream on any thread, transform the data and consumed it by an Observer on any thread. The library offers operators like map, combine, merge, filter and lot more that can be applied onto data stream. Below are the list of schedulers available and their brief introduction. - Schedulers.io() – This is used to perform non CPU-intensive operations like making network calls, reading disc / files, database operations etc., This maintains pool of threads.
- AndroidSchedulers.mainThread() – This provides access to android Main Thread / UI Thread. Usually operations like updating UI, user interactions happens on this thread. We shouldn’t perform any intensive operations on this thread as it makes the app glitchy or ANR dialog can be thrown.
- Schedulers.newThre...
Android tutorials, Kotlin tutorials