Treatment compress
compression/brotli::compress
Parameters
↳ var level: i32 = 6
Inputs
⇥ data: Stream<byte>
Outputs
↦ completed: Block<void>
↦ compressed: Stream<byte>
↦ error: Block<string>
↦ failed: Block<void>
↦ finished: Block<void>
Compresses data with brotli.
The bytes received through data are compressed with brotli at level, from 0 (fastest) to 11 (smallest), 6 by default, and given through compressed while they come, as one brotli stream.
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