Module subscription
Expand description
The transport-neutral half of a subscription
(docs/design/subscriptions-websocket.md §6.1).
A binding — SSE, WebSocket, WebTransport — only moves frames. Opening a
subscription (policy, setup, backplane registration) and producing its
items is the SubscriptionDispatcher’s job, so every binding enforces
exactly the same thing and none of them carries its own copy of the
policy code.
Values cross this boundary as serde_json::Value, the same opaque
codec value RpcRequest::input / RpcResponseFrame::output already use:
the binding decodes its wire codec into it and encodes items back out,
so a dispatcher never knows which codec or transport it is serving.
Structs§
- Subscription
Open - Everything a dispatcher needs to open one subscription. Owned, so the
future
SubscriptionDispatcher::openreturns borrows nothing from the binding’s connection state.
Traits§
- Subscription
Dispatcher - Opens subscriptions by op id. Implemented by generated code (one impl per schema); called by every subscription binding.
Type Aliases§
- Subscription
Stream - A live subscription’s items. Ending (
None) means the subscription is over; anErritem is terminal too — the binding sends it and stops.