Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val job = launch {
// fire and forget task is done here
}
val deferredJob = async<Int> {
// a job which returns some result
}
// Block until deferredJob returns with the result
val result = deferredJob.await()
runBlocking {
// Block the calling thread until this block
// execution isn't complete
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment