Oleg Siboglov
joining
second started
fun main() = runBlocking { val job = GlobalScope.launch { val deferredOne = async(<http://Dispatchers.IO|Dispatchers.IO>) { println("first started") delay(1_000) println("first finished") } val deferredTwo = async(<http://Dispatchers.IO|Dispatchers.IO>) { println("second started") delay(2_500) println("second finished") } println("joining") deferredOne.join() deferredTwo.join() println("complete") } job.join() }
first started joining second started first finished second finished complete
Zach Klippenstein (he/him) [MOD]
Casey Brooks
async
A modern programming language that makes developers happier.