I have a concurrent execution of some tasks using ...
# coroutines
l
I have a concurrent execution of some tasks using async and awaitAll. How do I wrap the awaitAll in such a way that I can handle each task failure separately. Currently only the first failure is caught. I am using supervisor scope
l
Can you make each task handle its own failure and produce a result according to the success, without throwing?
l
I was thinking about that—will try. So there is no good way to do it in coroutines world?
j
I tend to do what @louiscad mentioned but add wrappers so a List<Deferred<T>>.handleFailure() function can be used. You could wrap each deferred in a Result and handle failures within this extension for example
e
something like this? https://pl.kotl.in/PFqbdlYiH
👍 1
👏 1
🙏 1
l
Thanks a lot, all!