effect-pubsub-event-bus

Installation
SKILL.md

PubSub Event Bus with Effect v4

Baseline: effect@4.1.0 stable. Inspect PubSub.ts, Stream.ts, and their implementations with git show effect@4.1.0:packages/effect/src/<Module>.ts in the Effect reference repository, rather than reading newer main as the contract.

Overview

Effect's PubSub module provides a typed, composable publish/subscribe primitive. Combined with Stream.fromPubSub and Effect.forkScoped, it replaces imperative callback-based event buses with a fully typed, stream-based subscription model where cleanup is automatic.

When to use this skill:

  • Building intra-service communication (event bus, message broker)
  • Replacing callback-based event systems with typed streams
  • Implementing reactive patterns where services subscribe to domain events
  • Managing per-instance event channels with scoped cleanup

Import Pattern

Installs
3
GitHub Stars
11
First Seen
Aug 27, 2026