-
Notifications
You must be signed in to change notification settings - Fork 4
feat: implement compression stream in c++ #43
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
Conversation
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.
Looks great 🚀
I tried really hard, but I found only a few nit picks, and one non-standard function. I haven't fully checked for compliance with the spec. Only DecompressionStream
is missing ;)
controller.enqueue(new Uint8Array(compressedData)) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
}, | ||
flush(controller) { |
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.
[nit] This is not a standard method. Can we get rid of it, and automatically flush when the stream is closed?
* init * fix * Revert changes' * fix: android build * chore: tweaks * chore: share const
cpp zlib is better, writes headers automatically, so we can get rid of that logic.
As a next step, I guess we could implement streams in C++, but unfortunately, we can't pass them as arguments to Swift/Kotlin HybridObjects, so in case there's a platform API that want to consume stream, this would not work.
So maybe in the future, I talk to Marc at the conference about this.