MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / encode_batch

Method encode_batch

crates/client-api/src/routes/subscribe.rs:1477–1486  ·  view source on GitHub ↗

Encode a drained batch according to the websocket version negotiated by the client.

(
        &mut self,
        message_batch: &mut Vec<OutboundWsMessage>,
    )

Source from the content-addressed store, hash-verified

1475 /// Encode a drained batch according to the websocket version negotiated by
1476 /// the client.
1477 async fn encode_batch(
1478 &mut self,
1479 message_batch: &mut Vec<OutboundWsMessage>,
1480 ) -> Result<(), mpsc::error::SendError<Frame>> {
1481 match self.config.version {
1482 WsVersion::V1 => self.encode_v1_batch(message_batch).await,
1483 WsVersion::V2 => self.encode_v2_batch(message_batch).await,
1484 WsVersion::V3 => self.encode_v3_batch(message_batch).await,
1485 }
1486 }
1487
1488 /// Encode a batch for the original v1 websocket protocols.
1489 ///

Callers 1

ws_encode_taskFunction · 0.80

Calls 3

encode_v1_batchMethod · 0.80
encode_v2_batchMethod · 0.80
encode_v3_batchMethod · 0.80

Tested by

no test coverage detected