I’m trying to understand how scopes are ment to us...
# coroutines
f
I’m trying to understand how scopes are ment to use. I have a sample implementation of a
mapAsync
function. The goal here is to process and map the result of every item asynchronously, but I want to cancel all tasks as soon as one of them fail, also I don’t want to cancel the parent scope. What do you think of this example:
🤔 1
d
Lose the
supervisorScope
.
m
I think you should let the parent scope decide whether it should be cancelled or not if the
mapAsync
fails. That shouldn't be the concern of
mapAsync
itself.
👍🏼 2