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
louiscad
08/19/2021, 11:35 PM
Can you make each task handle its own failure and produce a result according to the success, without throwing?
l
liminal
08/19/2021, 11:49 PM
I was thinking about that—will try. So there is no good way to do it in coroutines world?
j
Jeff Z
08/20/2021, 12:20 AM
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