pub fn sync_frame(
state: &DispatchState,
session_id: &str,
) -> Result<Option<ClientOp>>Expand description
The durable frame one session’s current projection publishes, or None
when the store holds no row for it.
sync_session sends this through send_frame, which already queues it when
the link is down; the frame is exposed separately for the caller whose send
failed for some other reason and owes the exit a second attempt through
DispatchState::enqueue_op.
The session’s own id is what the server keys the mirror by, and it stays put
while a scope hands the session delivery after delivery. The delivery travels
beside it as task_id: the one the session is bound to now, or the last one
it served once the binding is released. Whether the session is between
deliveries is the projection’s own delivery dimension, not the id’s — so the
mirror keeps reading the delivery a row belongs to while the pair says the
session is live.
A session whose row was never given a delivery sends an empty task_id,
which is the wire’s only spelling for “this session is on no delivery”; a
client-held session always has the delivery that opened it.