This PR proposes a new module for Arrow Fx Coroutines, which covers the existing behavior in Arrow Fx but in a generalised way using DSLs.
[x] parMapN is covered by AwaitAllScope
[x] Resource already was a DSL, Scoped offers a similar but more lightweight DSL (no ExitCase), and simplified SAM.
[ ] raceN will be covered by RacingScope (#3342)
[ ] parZipOrAccumulate should be covered by a combination of AwaitAllScope & `Accumulating)
All the above non-DSL variants, can be implemented by their DSL variations. Simplifying the internals of Arrow Fx Coroutines. The idea behind this is future proofing, since my ambition for 3.0 is to split Raise and the typed error handling DSL from Arrow Core such that users can rely on only the DSL after 3.0. That should be do-able with only a single binary breakage in Arrow Core, so 3.0 should be source compatible, and 99% binary compatible once Context Parameters are released.
[ ] Write tests
[ ] Check all edge-cases with AwaitAllScope
[ ] Implement parZipOrAccumulate DSL
[ ] Finish RacingScope
Investigate if we need, or want, <E> variants when inside Raise<E>.
This PR proposes a new module for Arrow Fx Coroutines, which covers the existing behavior in Arrow Fx but in a generalised way using DSLs.
parMapN
is covered byAwaitAllScope
Resource
already was a DSL,Scoped
offers a similar but more lightweight DSL (noExitCase
), and simplified SAM.raceN
will be covered byRacingScope
(#3342)parZipOrAccumulate
should be covered by a combination ofAwaitAllScope
& `Accumulating)All the above non-DSL variants, can be implemented by their DSL variations. Simplifying the internals of Arrow Fx Coroutines. The idea behind this is future proofing, since my ambition for 3.0 is to split
Raise
and the typed error handling DSL fromArrow Core
such that users can rely on only the DSL after 3.0. That should be do-able with only a single binary breakage in Arrow Core, so 3.0 should be source compatible, and 99% binary compatible once Context Parameters are released.AwaitAllScope
parZipOrAccumulate
DSLRacingScope
Investigate if we need, or want,
<E>
variants when insideRaise<E>
.