Expand description
§Message Compressor and Batching
Buffers IPC messages into batches, then compresses on
flush using Brotli / Gzip / Zlib at the configured level.
Compressor::Struct is the engine; the DTOs are split into
their own siblings.
Modules§
- Batch
Config - Compressor / batcher tunables - max batch size, max delay before flushing, the size threshold below which messages pass through uncompressed, and the algorithm + level pair.
- Batch
Stats - Lightweight in-flight batch counters - message count, current byte total, and elapsed time since the first message landed.
- Compressed
Batch - Result envelope returned by
Compressor::Struct::flush_batch. Carries the message count, original / compressed byte totals, the compressed bytes (Nonewhen below threshold), theCompressionInfo::Struct, and the flush timestamp. - Compression
Algorithm - Wire-format selector for the compressor - Brotli, Gzip, or Zlib. The compressor delegates to the matching encoder / decoder pair.
- Compression
Info - Per-batch compression metadata - algorithm name, level,
and the achieved ratio.
none()produces the uncompressed sentinel (algorithm:"none",ratio:1.0). - Compression
Level - Compression strength dial -
Fast(1),Balanced(6),High(11). Maps directly to Brotli quality / flate2 compression level. - Compressor
Compressor::Struct- message batching + compression engine. Buffers messages until size or time triggers a flush, then emits aCompressedBatch::Structusing the configured algorithm. Struct + 14-method impl + utility functions stay in one file - tightly coupled cluster.