Skip to content

Instantly share code, notes, and snippets.

@ShkurtiA
Created December 10, 2018 16:21
Show Gist options
  • Save ShkurtiA/05db6ff5ffcb19faca9a6d3cd5fd1a99 to your computer and use it in GitHub Desktop.
Save ShkurtiA/05db6ff5ffcb19faca9a6d3cd5fd1a99 to your computer and use it in GitHub Desktop.
Observable.just(1) // 1 will be emited in the IO thread pool
.subscribeOn(Schedulers.io())
.flatMap(...) // will be in the IO thread pool
.observeOn(Schedulers.computation())
.flatMap(...) // will be executed in the computation thread pool
.observeOn(AndroidSchedulers.mainThread())
.subscribe(); // will be executed in the Android main thread (if you're running your code on Android)
@ShkurtiA
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment