Skip to content

Instantly share code, notes, and snippets.

@GauravChaddha1996
Created January 30, 2021 18:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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