Hey! I'm learning about coroutines and have a pret...
# coroutines
b
Hey! I'm learning about coroutines and have a pretty simple question (I think). I want to do two tasks concurrently:
Copy code
val first:  Deferred<Unit> = async { firstTask() }
val second: Deferred<Unit> = async { secondTask() }

first.await().let { doFirstStuff() }
second.await().let { doSecondStuff() }
In this example, will the
doFirstStuff()
always be called before
doSecondStuff()
? Or can
doSecondStuff
trigger as soon as
second
is evaluated (this is what I want to achieve)?
u
Checkout select
b
Interesting, thanks 🙂