-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose ZlibCompressor/Decompressor #10
Conversation
/// - flush: how compressor should flush output data. | ||
/// - process: Closure to be called when window buffer fills up or compress has finished | ||
/// - Returns: `ByteBuffer` containing compressed data | ||
public mutating func compressStream( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this work with an AsyncSequence as in- and/or output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can review some of the APIs but as the Compressor is non-copyable we have to be clearer about who owns it. So using it in an AsyncSequence is problematic. Eg I have a compressor I want to re-use, if I create an AsyncSequence that takes ownership of it there is no easy to pass it back once iteration has completed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, unfortunate.
Also clean up interface so when they are allocated they are active already, instead of having non-initialized state
This PR