Skip to content

Instantly share code, notes, and snippets.

@longv
Last active February 1, 2021 22:37
Show Gist options
  • Save longv/d49e83902a383e63835b5b24bba3291b to your computer and use it in GitHub Desktop.
Save longv/d49e83902a383e63835b5b24bba3291b to your computer and use it in GitHub Desktop.
fun debugSubscribeOn(): Disposable =
Observable.just(1, 2, 3)
.doOnNext {
println(Thread.currentThread().name) // RxCachedThreadScheduler-1
}
.subscribeOn(Schedulers.io())
.doOnNext {
println(Thread.currentThread().name) // RxCachedThreadScheduler-1
}
.subscribe()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment