Skip to content

Instantly share code, notes, and snippets.

@GauravChaddha1996
Created January 30, 2021 18:12
Show Gist options
  • Save GauravChaddha1996/c2d2ff83d93fc3cffff719a1050da35e to your computer and use it in GitHub Desktop.
Save GauravChaddha1996/c2d2ff83d93fc3cffff719a1050da35e to your computer and use it in GitHub Desktop.
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