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
http2: support Strict entities in Http2SubStream #3824
http2: support Strict entities in Http2SubStream #3824
Conversation
Needs tests |
Actually, it cannot be observed from the outside, so I guess no particular tests are necessary. There are tests that examine sending Strict entities in general. |
This avoids materializing a stream for outgoing Strict entities.
e5d5076
to
5612e4e
Compare
Test PASSed. |
|
||
var httpFlow: Flow[ByteString, ByteString, Any] = _ | ||
implicit var system: ActorSystem = _ | ||
implicit var mat: ActorMaterializer = _ | ||
|
||
val packedResponse = ByteString(-62, -63, -64, -65, -66) | ||
val packedResponse = ByteString(1, 5, 0, 0) // a HEADERS frame with end_stream == true |
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.
Nice
// TODO: Check that buffer is not too much over the limit (which we might warn the user about) | ||
// The problem here is that backpressure will only work properly if batch elements like | ||
// ByteString have a reasonable size. | ||
if (buffer.size < multiplexer.maxBytesToBufferPerSubstream && !inlet.hasBeenPulled && !inlet.isClosed) inlet.pull() | ||
} | ||
if (!upstreamClosed && buffer.size < multiplexer.maxBytesToBufferPerSubstream && !inlet.hasBeenPulled && !inlet.isClosed) inlet.pull() |
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.
👍
This avoids materializing a stream for outgoing Strict entities.
Another ready result from #3822.