Effect.fork for background work
Use Effect.fork to run an Effect in the background. It returns a Fiber that you can join to get the result, or interrupt to cancel.
In the anti-pattern, we block on everything. In the Effect way, we fork and continue.
- Use
Effect.fork(effect)to run in background - Returns a
Fiber- usefiber.jointo wait for result - Use
Fiber.interruptto cancel
Loading code editor...