Dashboard › opencode › Effect background layer loops
01a0a0db-fcb6-7118-ba41-7db7decf1b2aAlways implement scheduled or repeating Effect background work with Effect.repeat or Effect.schedule, forked via Effect.forkScoped inside the owning layer definition. Ad hoc promises or handler-started loops look simpler but escape layer lifetime and cleanup; layer-scoped fibers preserve process-global ownership and deterministic shutdown.