Last active
March 25, 2024 19:17
-
-
Save ahinchman1/d16629f607bfd740378568d513a8c6ee 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
fun main() = runBlocking { | |
println("runBlocking main") | |
val scope = CoroutineScope(Job()) | |
println("scope created. Create job...") | |
val job = scope.launch { | |
val task1 = runBlocking { | |
println(" task1") | |
// simulate a background task | |
delay(1000) | |
println(" task1: Done background task") | |
} | |
val task2 = runBlocking { | |
println(" task2") | |
// simulate a background task | |
delay(1000) | |
println(" task2: Done background task") | |
} | |
} | |
println("Program ends") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment