Skip to main content

do_websocket_sink

Function do_websocket_sink 

Source
pub fn do_websocket_sink(
    send: impl Fn(&[u8]) + Send + Sync + 'static,
) -> SnapshotSink
Expand description

Build a SnapshotSink that forwards snapshots to a DO’s WebSocket send.

The caller provides the send function (which is worker::WebSocket::send or equivalent). This lets the shard’s broadcast loop push snapshots to connected clients over the DO’s own WebSocket.