Say I have a list of objects that each have their own coroutine scope, and I want to execute a function on every one of them - in a way that if their coroutine scope is cancelled, said function is cancelled too.
However, if one of said functions fails - and not because it is cancelled - I want it to throw its exception, and cancel all the other ones.
How would I do this such a thing?
What I mean is, similarly to
awaitAll
- but when encountering a
CancellationException
, it just silently ignores it instead of cancelling all the other coroutines, similarly to
SupervisorJob
.
Laxystem
03/13/2024, 11:25 AM
Found something that I think works -- just voiding cancellations. Don't like it tho.
@Joffrey a dependency in this case is just an extension that happens to be a dependency of another.
We want to have dynamically un/loadable extensions, and therefore each one has to have its own scope, for cancellabilty purposes.
Laxystem
03/13/2024, 3:52 PM
Besides, it's an amazing way to know what extension executed what code.