Skip to content

Instantly share code, notes, and snippets.

@zjuhasz
Created August 4, 2017 14:50
Show Gist options
  • Save zjuhasz/bef3aa1dea590783864b84f437f14a62 to your computer and use it in GitHub Desktop.
Save zjuhasz/bef3aa1dea590783864b84f437f14a62 to your computer and use it in GitHub Desktop.
// This is using the abstractions in Kotlinx.coroutines
val mainThreadContext = newSingleThreadContext("mainThreadContext")
fun main(args: Array<String>) = runBlocking(mainThreadContext) {
println("hello world!")
}
@IgorGanapolsky
Copy link

Question, why is runBlocking used? Aren't Coroutines supposed to be for non-blocking operations.

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