Module events
Expand description
Model-event bus: typed created/updated/deleted envelopes that
procedure handlers can subscribe to.
Structs§
- Cratestack
Event Bus - Cratestack
Event Envelope - Model
Event - Subscription
Guard - RAII cleanup for one or more
CratestackEventBussubscriptions that all share one lifecycle — e.g. the per-operation handlers a singleGET /rpc/subscribe/{op_id}connection registers for the duration of its SSE stream (docs/design/rpc-transport.md§3.4a, cratestack#390). Every tracked handle is unsubscribed when the guard drops, whether that’s because the underlying stream ended normally (backpressure overflow) or because it was cancelled mid-poll (an ordinary client disconnect) — both just drop this guard the same way, so cleanup doesn’t need to special-case which one happened. Without this, a long-running server would accumulate one permanently-registered, permanently-a-no-op handler per historical connection — a real unbounded-memory footgun for a public, freely-reconnectable endpoint, not a hypothetical one. - Subscription
Handle - Opaque token returned by
CratestackEventBus::subscribe, needed to later remove that exact handler viaCratestackEventBus::unsubscribe. Fields are private — the only way to obtain one issubscribe, and the only thing it’s good for is passing back tounsubscribe.