Adds a channel (and its provided schema, if any), returning its ID.
Useful with subequent calls to
Write the given message (and its provided channel, if needed).
Write a message to an added channel, given its ID.
This skips hash lookups of the channel and schema if you already added them.
Finishes the current chunk, if we have one, and flushes the underlying writer.
We finish the chunk to guarantee that the file can be streamed by future readers at least up to this point. (The alternative is to just flush the writer mid-chunk. But if we did that, and then writing was suddenly interrupted afterwards, readers would have to try to recover a half-written chunk, probably with an unfinished compresion stream.)
Note that lossless compression schemes like LZ4 and Zstd improve as they go, so larger chunks will tend to have better compression. (Of course, this depends heavily on the entropy of what’s being compressed! A stream of zeroes will compress great at any chunk size, and a stream of random data will compress terribly at any chunk size.)
Finishes any current chunk and writes out the rest of the file.
Subsequent calls to other methods will panic.
Returns the argument unchanged.