https://kotlinlang.org logo
#coroutines
Title
# coroutines
d

darkmoon_uk

09/08/2019, 1:46 AM
Is there an (idiomatic) way to iterate over
Iterable<Deferred<T>>
?
s

streetsofboston

09/08/2019, 2:35 AM
Not sure it's defined on
Collection
, or
Iterable
, but is
awaitAll<T>()
the method/function you're looking for?
g

gildor

09/08/2019, 2:58 AM
awaitAll awaits all the results, do not allow you to get them one by one, but depends on use case. You can write simple extension to convert it to Flow, it would provide much more flexibility (or even avoid creating list of deferred and use Flow directly)
5 Views