use write data API in bidirectional streaming#3809
Merged
Conversation
baa395f to
f5c3bd7
Compare
7ec51c5 to
a657579
Compare
DmitriyMusatkin
approved these changes
Apr 28, 2026
122992e to
281d322
Compare
sbaluja
reviewed
Apr 29, 2026
sbaluja
reviewed
Apr 29, 2026
281d322 to
cfcf9e0
Compare
sbaluja
approved these changes
Apr 29, 2026
pulimsr
reviewed
Apr 29, 2026
pulimsr
approved these changes
Apr 29, 2026
d5a5baf to
c418a10
Compare
c418a10 to
e7bd49a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
#3257
Description of changes:
This changes the implementation of bidirectional streaming when using the CRT HTTP client to use a push-based API rather than a polling-based API. Previously, bidirectional streaming used a
ConcurrentStreamBufthat the HTTP client polled in a hot loop waiting for data/ Now, when built with-DUSE_CRT_HTTP_CLIENT=ON, the SDK usesHttpWriteDataStreamBufwhich pushes data directly to the HTTP/2 connection the moment it's written. This is fully backwards compatible. No code changes required. The same streaming code automatically benefits:This has been verified against the current transcribe example where CPU usage dropped from 100% to background noise levels. This applies to all bidirectional streaming operations across all services (Transcribe, Bedrock, QBusiness, Polly, ConnectHealth, etc.) and is only active when built with
-DUSE_CRT_HTTP_CLIENT=ON. The legacy path (libcurl/winhttp) is unchanged.Additionally this is an ongoing effort where the CRT HTTP client will eventually become the default client of the SDK. This fix will not be ported to libcurl or winhttp.
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.