pub struct FrameSink { /* private fields */ }Expand description
Cheaply cloneable handle to one connection’s bounded outbound frame queue.
Backends emit responses, streaming frames, and future PUSH frames through this
single path. The queue is bounded twice: by queued BYTES (the budget that
matters for memory and for how long a slow reader may pause), and by the
mpsc channel’s frame count (a backstop). The socket layer owns the sole
receiver/writer.
Implementations§
Source§impl FrameSink
impl FrameSink
Sourcepub fn new(tx: Sender<OutboundFrame>) -> Self
pub fn new(tx: Sender<OutboundFrame>) -> Self
A sink with the standard per-connection byte budget
(crate::server::CONNECTION_EGRESS_BYTE_BUDGET); the frame-count bound
is whatever capacity tx’s channel was created with.
pub async fn send(&self, frame: Frame) -> Result<(), RouterError>
Sourcepub async fn send_flushed(&self, frame: Frame) -> Result<(), RouterError>
pub async fn send_flushed(&self, frame: Frame) -> Result<(), RouterError>
Shutdown notices must leave the socket writer before an idle daemon exits. Queue admission alone does not prove this; the writer acknowledges flush.
The local endpoint uses it the same way for its clients-only refusal: the connection closes right after the refusal is sent, so the writer must flush it first.