Treatment compress
compression/zstd::compress
Parameters
↳ var level: i32 = 3
Inputs
⇥ data: Stream<byte>
Outputs
↦ completed: Block<void>
↦ compressed: Stream<byte>
↦ error: Block<string>
↦ failed: Block<void>
↦ finished: Block<void>
Compresses data with zstd.
The bytes received through data are compressed with zstd at level, from 1 (fastest) to 22 (smallest), 3 by default, and given through compressed while they come, as one zstd frame.
Once data ends and everything is given, completed is emitted. If level is not
supported or compression fails, failed is emitted and error contains the reason.
finished is emitted in every case.
graph LR
T("compress()")
B["… 🟦 🟦 🟦"] -->|data| T
T -->|compressed| O["… 🟪 🟪"]
T -->|completed| C["〈🟩〉"]
style B fill:#ffffff,stroke:#ffffff
style O fill:#ffffff,stroke:#ffffff
style C fill:#ffffff,stroke:#ffffff