Skip to content

Instantly share code, notes, and snippets.

@Diolor
Last active December 1, 2018 02:10
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/e545351e55a68ed6cd2b09c113099354 to your computer and use it in GitHub Desktop.
Save Diolor/e545351e55a68ed6cd2b09c113099354 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
.combineLatest(
just(Unit).observeOn(io()),
just(Unit).observeOn(computation())
) { _, _ ->
Unit
}
.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