effect-pubsub-event-bus

Community

Build typed Effect event buses with Streams.

Authormpsuesser
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Effect developers need a reliable way to coordinate publish/subscribe communication without messy callback lifecycles, untyped payloads, or manual cleanup that can cause leaks and inconsistent shutdown behavior.

Core Features & Use Cases

  • Typed event definitions: Use discriminated unions with Schema.TaggedClass so publishers and subscribers agree on payload shape.
  • Stream-based subscriptions: Turn PubSub channels into composable Streams via Stream.fromPubSub, enabling filtering, mapping, and backpressure behavior.
  • Scoped, automatic cleanup: Use Effect.forkScoped and finalizers to ensure subscriptions and PubSub shutdown happen when the owning Scope ends.
  • Event-driven service architecture: Replace imperative event buses with reactive, stream-first designs for inter-service domain events.

Quick Start

Implement an event union with Schema.TaggedClass, create a Bus Layer that uses PubSub plus Stream.fromPubSub, and subscribe with forkScoped so cleanup is tied to the layer scope.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: effect-pubsub-event-bus
Download link: https://github.com/mpsuesser/pi-effect-harness/archive/main.zip#effect-pubsub-event-bus

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.