Module replay

Module replay 

Source
Expand description

Replay transport — feed a recorded wire log back through the session loop.

ReplayTransport implements Transport over a recorded wire log (see crate::transport::recording): recv() yields the recorded inbound frames in order (as fast as the session loop consumes them), and send() collects outbound frames for later comparison instead of touching a network.

Because the session loop broadcasts events as soon as frames arrive, a replay that starts streaming before the application has subscribed would lose events nondeterministically. The transport is therefore gated: the first ungated_prefix frames (default 1 — the setupComplete handshake) are delivered immediately so the connection can reach Active, and the rest are held until ReplayControl::release is called. Once the inbound queue is exhausted the ReplayControl::drained signal fires and recv() pends (like MockTransport), keeping the session alive until it is disconnected.

Structs§

ReplayControl
Control handle for a ReplayTransport that has been moved into a session loop.
ReplayTransport
A Transport that replays recorded inbound frames and collects outbound frames. See the module docs for gating and drain semantics.

Enums§

ReplayTransportError
Errors from the ReplayTransport.

Type Aliases§

OutboundFrames
Shared collection of frames “sent” during a replay.