pub struct ReadWake { /* private fields */ }Expand description
Wakes a participant receive that is waiting on the socket with a budget.
§Which reads it interrupts
A wake ends, with SdkError::ReadInterrupted, a read made through a
budgeted participant door while it waits for bytes:
RemoteParticipantHandle::receive_within with a nonzero budget, whatever
the budget (including one at or above the 60 s response deadline that a
caller uses to await a correlated answer), and the wait for the liveness
Pong inside RemoteParticipantHandle::try_receive. A frame already
decoded is returned without waiting and so without consuming the wake, and
a zero budget never waits at all. The interrupted read keeps any
partly-arrived frame and the socket; a Pong still owed to an interrupted
try_receive is consumed by a later read.
The reply-owed door RemoteParticipantHandle::receive, and every
request/response exchange the transport makes for itself (publish,
subscribe, conversations, the handshake), never observe a wake. “Idle”
here means the door the caller chose, not whether a reply is owed: a caller
that awaits a reply through receive_within can be interrupted.
§Sharing
There is one ReadWake per transport, not per handle. Every clone of it,
every RemoteConfig sharing the transport, and every participant built
over that transport reach the same wake, and it carries over a participant
reconnect. A wake from any of them interrupts whichever interruptible read
on that transport observes it first, through whichever handle is reading;
it is not addressed to the caller that sent it.
Wake requests coalesce: a wake sent while no interruptible read is waiting stays pending and interrupts the next one, and several wakes before that read are one interrupt. A wake that lands while a reader is claiming an earlier one is never lost; at worst it costs one spurious interrupt of a later read. The handle holds only the wake pipe, so retaining it does not retain the transport socket or participant binding.