Skip to main content

Module protocol

Module protocol 

Source
Expand description

Wire format (ServerMsg / ClientMsg) for WS /v1/operators/:sid/ws. Wire format (= S↔C JSON message schema) for WS /v1/operators/:sid/ws.

ServerMsg = 4 messages the server pushes to the client (Ask / HookBefore / HookAfter / Spawn). ClientMsg = 3 messages the client replies with (Answer / HookAck / SpawnAck). For the parent module’s message-flow figure, see the doc of mod.rs.

PendingReply is the intermediate representation delivered over the internal oneshot reply channel, used to resolve a ClientMsg (arriving from a client) against the session’s pending HashMap keyed by req_id. See session::WSOperatorSession::resolve_pending for details.

Enums§

ClientMsg
Client → server reply messages on WS /v1/operators/:sid/ws. Each variant resolves the pending oneshot registered under its req_id (see super::session::WSOperatorSession::resolve_pending).
ServerMsg
Server → client push messages on WS /v1/operators/:sid/ws. Each variant pairs with a ClientMsg reply carrying the same req_id (except HookAfter, which is fire-and-forget).