Created
January 30, 2021 18:12
-
-
Save GauravChaddha1996/c2d2ff83d93fc3cffff719a1050da35e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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