Skip to content

Instantly share code, notes, and snippets.

@longv
Last active February 1, 2021 22:36
Show Gist options
  • Save longv/92d22bcf1d14593f5bac6e7d617ba793 to your computer and use it in GitHub Desktop.
Save longv/92d22bcf1d14593f5bac6e7d617ba793 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())
.subscribeOn(Schedulers.computation())
.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