Henri Gourvest
12/07/2023, 10:28 PMsuspend fun foo() = callbackFlow {
coroutineScope {
launch {
delay(100)
channel.send(1)
}
launch {
delay(100)
channel.send(2)
}
}
channel.close()
}
kevin.cianfarini
12/07/2023, 10:39 PMcoroutineScope
builder function.Henri Gourvest
12/07/2023, 10:47 PMCasey Brooks
12/07/2023, 10:56 PMsuspend fun foo(): List<Int> = coroutineScope {
listOf(
async {
delay(100)
1
},
async {
delay(100)
2
}
).awaitAll()
}
Henri Gourvest
12/07/2023, 11:33 PM