-
Notifications
You must be signed in to change notification settings - Fork 32
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
Allow to select flushing strategy NoFlush
is the default, but the `…
#10
base: master
Are you sure you want to change the base?
Conversation
…SyncFlush` is useful with the incremental compression eg. websockets
;) I see no conflict. This change is independent of the other. I.e. it controls the default behavior. The other change (the proposed api change) will still be needed, as there is no explicit way flush buffer while building with |
@tolysz the conflict I see (unless I'm wrongly assuming what this PR does): the new API would give you the choice to either flush explicitly (via
but if you change the default, PS: or let me ask differently (as then I may understand better): what does #10 make possible to do we couldn't already do if #6 was already implemented? |
There will be applications which will require PUSH and PULL but you are right - not all combination for flush-strategy and explicit flushing will make sense. The PR works and it should be transparent to most users. I am using it in implementation of permessage-deflate for WebSockets (formatRaw), thus I would need to call flush each time. PR will do it for me at the c level. ps. |
@tolysz are you sure this is what you really want? This would flush after every block, whereas even for websockets or whatever surely you'd want to flush at logical protocol boundaries rather than abitrary intermediate points depending on how the lazy bytestring was constructed. I suspect that the stream interface with explicit flushing would work best for your use case, but I could be wrong. I'd be happy to get a more detailed explanation. |
It my still be useful, but in the end I switched to |
Allow to select flushing strategy
NoFlush
is the default, but theSyncFlush
is useful with the incremental protocols eg. compression with websockets