Introduce awaitAll and joinAll extensions for collections for Deferreds/Jobs
See original GitHub issuejoinAll
is simple map { it.join() }
, while awaitAll
needs a slightly more involved implementation than a simple map { it.await() }
. It shall actually wait on all of the deferreds from collection and crash as soon as any one of them crashes.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Awaiting Multiple Coroutines the Clean Way | by Matt Robertson
When we launch a coroutine in Kotlin using launch we are returned the resulting Job. We can wait for the coroutine to finish...
Read more >awaitAll - Kotlin
Awaits for completion of given deferred values without blocking a thread and resumes normally with the list of values when all deferred computations...
Read more >Kotlin Coroutines - How to block to await/join all jobs?
I want all calls to launch concurrently, and block until all calls are done/the response is acted on, and then return a new...
Read more >Java源代码 - 摸瓜
AwaitKt$awaitAll$2.java; AwaitKt$joinAll$1.java; TimeoutCancellationException.java; CoroutinesInternalError.java; bm.java; b.java; ci.java; bi.java; w.java ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
onEach
should be considered to avoid collection’s copy.@raulraja We try to keep
kotlinx.coroutines
idiomatic with respect to Kotlin stdlib. We don’t plan to have any multiple-arity overloads. Idiomatic way to write your code is: