Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s2: Add AsyncFlush method: Complete the block without flushing (#927)
* s2: Add AsyncFlush method: Complete the block without flushing My use case is to transfer a large compressed S2 stream with a few changes very often. To get a small diff I want to end blocks at application decided points rather than at byte offsets. This allows me to remove the first byte without every single block changing. Flush() works for this, but it limits concurrency because it waits for the last block to be compressed rather than allowing that asynchronously. So I'd like to propose AsyncFlush, which flushes the buffer to a block, but doesn't flush the block to the io.Writer. There were actually a few places in the s2 code that also wanted to end the block, but didn't necessary want to flush to the writer. * Update s2/writer.go Co-authored-by: Klaus Post <[email protected]> --------- Co-authored-by: Klaus Post <[email protected]>
- Loading branch information