Module backplane
Expand description
The subscription backplane (docs/design/subscriptions-websocket.md §4):
how a published message reaches every replica, so a subscriber connected
to one replica sees a write committed on another.
This module holds the contract, the one-replica InProcessBackplane
(and the [LocalHub] fan-out it shares with Postgres’ PgNotifyBackplane,
in cratestack-sqlx), and the TopicHandle a schema topic is read
and written through. None of it touches a database, so a db = None
schema’s topics ride on it too.
Delivery is at-most-once (§2.1). A backplane that may have lost messages
says so with BackplaneMessage::Resync, and every subscription on that
channel ends with unavailable, so the client knows to refetch rather than
trust a stream with a silent gap.
Structs§
- InProcess
Backplane - Topic
Handle - One topic under one key. Cheap to build; hold none.
Enums§
- Backplane
Message - One delivery on a backplane channel.
Traits§
- Subscription
Backplane - Fans a published message out to every replica, this one included.
Functions§
- model_
event_ channel - The backplane channel model events of
modelare published on. - topic_
channel - The backplane channel of
topic’s messages underkey(topic RoomMessage(roomId: String): ChatMessage, slice S4):cratestack.topic.RoomMessage.<key>.
Type Aliases§
- Backplane
Future - A boxed future, so the trait stays object-safe (
Arc<dyn SubscriptionBackplane>). - Backplane
Receiver - What
SubscriptionBackplane::subscribereturns: everything published on the channel from the moment the subscription is established.