You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
0 commit comments