Skip to main content

Module subscription

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§

SubscriptionOpen
Everything a dispatcher needs to open one subscription. Owned, so the future SubscriptionDispatcher::open returns borrows nothing from the binding’s connection state.

Traits§

SubscriptionDispatcher
Opens subscriptions by op id. Implemented by generated code (one impl per schema); called by every subscription binding.

Type Aliases§

SubscriptionStream
A live subscription’s items. Ending (None) means the subscription is over; an Err item is terminal too — the binding sends it and stops.