WukongRework.exe
import kotlinx.coroutines.* fun main() = runBlocking { launch { delay(100) println("@ launch") } withContext(newSingleThreadContext("new Context")) { delay(200) println("@ withContext") } println("@ runBlocking") } // Outputs @ launch @ withContext @ runBlocking
import kotlinx.coroutines.* fun main() = runBlocking { launch { delay(100) println("@ launch") } launch(newSingleThreadContext("new Context")) { delay(200) println("@ withContext") } println("@ runBlocking") } // Outputs @ runBlocking @ launch @ withContext
Tijl
withContext
launch
andylamax
A modern programming language that makes developers happier.