Layer or a ManagedRuntime.
Simple path: provide a layer
Useeos.provide(AppLive) when per-call acquisition is acceptable and you do not need to own runtime shutdown.
layer.ts
Long-lived resources: own the runtime
UsemakeEffectORPC(runtime) when scoped resources should be acquired once and released on application shutdown.
runtime.ts
- database pools
- telemetry SDKs
- HTTP clients with connection pools
- caches
- long-lived scoped resources
Wrap an existing oRPC builder
If your application already has an oRPC builder, wrap it:wrap-builder.ts
Rule of thumb
| Need | Use |
|---|---|
| Small app, examples, simple services | eos.provide(AppLive) |
| Shared scoped resources with explicit shutdown | makeEffectORPC(ManagedRuntime.make(AppLive)) |
| Existing oRPC builder | makeEffectORPC(existingBuilder).provide(AppLive) |