Framework.Sequencer.PubSubBridge (Framework v0.5.0)
View SourcePubSub bridge for real-time event streaming integration.
Bridges PostgreSQL NOTIFY with Phoenix PubSub to enable real-time event streaming to connected clients while maintaining architectural guarantees:
- NOTIFY remains a wake hint only (non-critical)
- Range-scan delivery is still authoritative
- Client reconnections remain deterministic via cursor
- All Phoenix transport guarantees are preserved
Architecture
- Listens to PostgreSQL NOTIFY from outbox_update
- Translates to Phoenix PubSub messages
- Connected clients receive wake hints via channels
- Clients use StreamEmitter.stream_from(cursor) for authoritative data
This maintains the architectural principle that NOTIFY failure cannot affect correctness - clients would still get events on reconnect.
Summary
Functions
Returns a specification to start this module under a supervisor.
Broadcast outbox update notification to PubSub.
Get PubSub topic name for external subscribers.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Broadcast outbox update notification to PubSub.
This is called after successful event append to notify all connected clients that new events are available. Maintains the same semantics as the original NOTIFY - failure is non-critical.
Get PubSub topic name for external subscribers.