I’m doing multiple concurrent API calls. It reads ...
# coroutines
r
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
why you want combined await function ? in that case you can write
val a = ….await() ; val b = ….await() ; …
m
@tateisu That would make the calls run sequentially instead of in parallel.
t
you want collect async{} to one place without missing type information?
👍 1