Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
runBlocking {
val scope = CoroutineScope(Dispatchers.IO)
val j = scope.launch {
println("Inside parent job")
delay(50)
val p = launch {
println("Inside child job")
delay(500)
println("Ending of child job")
}
p.join()
println("Ending of parent job")
}
j.join()
}
Output:
Inside parent job
Inside child job
Ending of child job
Ending of parent job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment