-
Notifications
You must be signed in to change notification settings - Fork 2
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
Introduce responseStreamingIface
#9
Introduce responseStreamingIface
#9
Conversation
Prior to this commit, when a server finished streaming, it had no way of indicating this (i.e. it has no way of setting the second argument to `StreamingBuilder`). As a result, `http2` would emit a final DATA frame when it finished the processing the builder along with a subsequent *empty* data frame when processing `StreamingFinished`. This results in an empty data frame at the end of every response. If the volume of responses is high, this even triggers the `emptyFrameRateLimit` in `http2`.
@kazu-yamamoto We renamed |
dec | ||
finished :: Maybe CleanupStream -> NextWithTotal | ||
finished mdec = \total _buf _room -> do | ||
fromMaybe (return ()) mdec | ||
return $ Next total True Nothing |
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.
In the future, it might make sense to avoid requesting a flush here if total == 0
, to prevent any empty data frames from being sent.
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.
LGTM
Merged. Thanks! |
## 0.3.0 * Breaking change: fillFileBodyGetNext takes Sentinel instead of IO () to close files on time. ## 0.2.1 * Add outBodyCancel to OutBodyIface [#11](kazu-yamamoto/http-semantics#11) * Documentation improvement. [#10](kazu-yamamoto/http-semantics#10) [#11](kazu-yamamoto/http-semantics#11) ## 0.2.0 * Introduce `responseStreamingIface` [#9](kazu-yamamoto/http-semantics#9) ## 0.1.2 * Avoid buffer overflow in fillBufBuilderOne [#4](kazu-yamamoto/http-semantics#4) ## 0.1.1 * Avoid buffer overflow in runStreamingBuilder [#3](kazu-yamamoto/http-semantics#3) ## 0.1.0 * Make it possible to guarantee that final DATA frame is marked end-of-stream. [#2](kazu-yamamoto/http-semantics#2) ## 0.0.1 * Defining getResponseBodyChunk'. [#1](kazu-yamamoto/http-semantics#1)
Prior to this commit, when a server finished streaming, it had no way of indicating this (i.e. it has no way of setting the second argument to
StreamingBuilder
). As a result,http2
would emit a final DATA frame when it finished the processing the builder along with a subsequent empty data frame when processingStreamingFinished
. This results in an empty data frame at the end of every response. If the volume of responses is high, this even triggers theemptyFrameRateLimit
inhttp2
.