- Create docs/architecture/event-targets/ with individual specs: in-process, redis, websocket-client, websocket-server, worker, iroh-spoke, iroh-hub - Update event-targets.md to serve as index with topology model (symmetric vs fan-out) and adapter status table - Update architecture.md index to reference new directory
1010 B
1010 B
status, last_updated
| status | last_updated |
|---|---|
| draft | 2026-05-07 |
In-Process Event Target
No adapter needed. createPubSub uses new EventTarget() by default.
This works for single-process deployments where all pubsub participants share the same memory. The web standard EventTarget already implements addEventListener/dispatchEvent/removeEventListener.
const pubsub = createPubSub<MyEventMap>();
// uses new EventTarget() by default
Could be formalized as an explicit InProcessEventTarget for documentation purposes, but there's no functional need — the browser/Node EventTarget is the reference implementation of the TypedEventTarget contract.
Design Notes
- Topics use the
type:idstring convention (e.g.,"call.responded:uuid-123") CustomEvent.detailcarries the fullEventEnvelopeobject- No serialization — objects are passed by reference
- Synchronous dispatch — listeners fire immediately in the current call stack
- No connection lifecycle, no reconnection concerns