Expand description
Streaming zstd compression for the subscription WebSocket firehose.
One compressor/decompressor per connection, retaining the zstd window across
messages (context-takeover) for a high ratio on the similar notification
frames. The server compresses each notification into a Binary frame; the
client decodes it. The pair is dropped on disconnect, so a reconnect starts a
fresh stream. Opt-in rides crate::subscribe_config::SubscribeConfig so it
survives the management WebSocket proxy.
Structs§
- WsStream
Compressor - Per-connection streaming compressor. Each
Self::compresscall flushes the zstd stream so the returned bytes independently decode to that one message, while the dictionary window carries over to the next call. - WsStream
Decompressor - Per-connection streaming decompressor, the inverse of
WsStreamCompressor. Frames must be fed in the order they were produced.
Constants§
- WS_
COMPRESSION_ LEVEL - zstd level for the firehose; low because the win is context-takeover across similar messages, not the level (and the session workers are CPU-bound).