Skip to main content

open_upstream_bidi

Function open_upstream_bidi 

Source
pub async fn open_upstream_bidi<T>(
    session: &WebTransportSession<Connection, Bytes>,
    frame: Frame<T::Response>,
) -> Result<Frame<T::Request>, Error>
where T: Server<Error = Error> + Send + Sync + Clone + 'static,
Expand description

Opens a server-initiated bidirectional stream to the downstream client.

This allows the server to push RPC frames to the client over a new bidi stream. The returned writer/reader pair uses ServerCodec for frame encoding/decoding.

ยงr[impl jetstream.webtransport.upstream-initiated.use-case]

Use this for server-push scenarios where the server needs to initiate communication with the client (e.g., pushing notifications, streaming updates).