Skip to content

Instantly share code, notes, and snippets.

@Diolor
Created December 1, 2018 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Diolor/b8b9d71bc04fd082b8219c50b0320b5a to your computer and use it in GitHub Desktop.
Save Diolor/b8b9d71bc04fd082b8219c50b0320b5a to your computer and use it in GitHub Desktop.
fun printCurrentThread(tag: String) = println("$tag: ${Thread.currentThread().name.substringBefore("-")}")
fun main(args: Array<String>) {
printCurrentThread("main thread name")
Observable
.merge(
just(Unit).subscribeOn(Schedulers.computation()),
just(Unit).subscribeOn(Schedulers.io())
)
.subscribe {
printCurrentThread("subscribe onNext")
}
Thread.sleep(100L)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment