Skip to content
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

On-demand flush #56

Open
mfulton26 opened this issue Apr 8, 2024 · 3 comments
Open

On-demand flush #56

mfulton26 opened this issue Apr 8, 2024 · 3 comments

Comments

@mfulton26
Copy link

I have a suspicion that using text/event-stream with CompressiomStream could cause delays in delivering events to consumers but I'm not sure that's true or not. It seems to me that after enqueing some event(s)/chunk(s) that the compression stream could be in a waiting state for more bytes to compress before it enques corresponding compressed chunk(s).

Is some flush() method needed in order to reliably send a compressed stream of events and to guarantee that individual events are not delayed?

Demo: https://dash.deno.com/playground/event-stream-example

@ricea
Copy link
Collaborator

ricea commented Apr 9, 2024

Yes. See also #22.

@mfulton26
Copy link
Author

Is there an expected flushing strategy for browsers to implement today for CompressionStream or is it undefined? If it is already "always" then I'm set for my current use cases but I'm guessing that is not the case. I wonder if there is an expected flushing strategy with which I might be able to find a workaround. Thank you.

@ricea
Copy link
Collaborator

ricea commented Apr 12, 2024

Sorry, it is implementation-dependant at the moment. I don't think there's a good workaround. We should make it a priority to fix #22 once the migration from WICG to WHATWG is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants