EffectTalk

When to use Runtime vs Effect.provide

Use a `ManagedRuntime` when you run many effects with the same layers—HTTP servers, long-running workers, REPLs. Use `Effect.provide(program, layer)` for one-off scripts or when each program has different needs.

  • Runtime: many effects, same layers, long-running
  • Effect.provide: single effect, one-off
  • Runtime needs dispose() for scoped resources
Loading code editor...