How to reuse outputs from effects with unbounded concurrency?
Hi, I've started using Effect a few days ago and I'm stuck trying to do something...
The image shows what I'm trying to do. I have a few tasks: task 1, task 2 (which needs the result from task 1), and task 3 (which also needs the result from task 1). I also only want each task to execute once.
My first try was to use
This approach works, but I couldn't find to make
This works, but I fear it would get more complicated as more tasks are needed and dependencies become more complex.
Ideally, I would want something like
The image shows what I'm trying to do. I have a few tasks: task 1, task 2 (which needs the result from task 1), and task 3 (which also needs the result from task 1). I also only want each task to execute once.
My first try was to use
Effect.do and the code looked something likeThis approach works, but I couldn't find to make
task2 and task3 execute in parallel with Effect.Do. So I tried Effect.gen:This works, but I fear it would get more complicated as more tasks are needed and dependencies become more complex.
Ideally, I would want something like
Effect.Do, but with concurrent evaluation of the effects.
