https://kotlinlang.org logo
Title
r

Rob

12/14/2020, 7:41 PM
I’m doing multiple concurrent API calls. It reads better with awaitAll() and destructuring but the types of the results are upcast to Any. Using await() looks uglier IMO but keeps the type information. Is there a way that reads like the former but still retains the type information like the latter?
A solution.
t

tateisu

12/15/2020, 2:11 AM
why you want combined await function ? in that case you can write
val a = ….await() ; val b = ….await() ; …
m

marstran

12/15/2020, 7:59 AM
@tateisu That would make the calls run sequentially instead of in parallel.
t

tateisu

12/15/2020, 8:01 AM
you want collect async{} to one place without missing type information?
👍 1