Any idea how I can improve this? I don’t need the ...
# coroutines
a
Any idea how I can improve this? I don’t need the first two vals, but I want to trigger the call at the same time
j
Copy code
launch { getA() }
launch { getB() }
or
Copy code
val jobA = launch { getA() }
val jobB = launch { getB() }

joinAll(a, b)
a
launch returns Job 🤔 I need the return value
j
you said you doesn't need the first two vals, but the fact is yes I think 🤔
if not, you will break the parallelism
a
Ah, sorry, I meant saving
deferredA
and
deferredB
seems too redundant. I’m wondering if something like this is possible
Copy code
val (a, b) = (async { getA() } to async { getB() }).awaitAll()
looking for a more concise way to represent simultaneous async calls