Skip to content

feat(gax): add BidiStreamOptions for bidirectional streaming - #6341

Merged
suzmue merged 2 commits into
googleapis:mainfrom
suzmue:bidi-stream-options
Aug 12, 2026
Merged

feat(gax): add BidiStreamOptions for bidirectional streaming#6341
suzmue merged 2 commits into
googleapis:mainfrom
suzmue:bidi-stream-options

Conversation

@suzmue

@suzmue suzmue commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Add BidiStreamOptions to google_cloud_gax::options to support configuring bidirectional streaming RPC parameters such as request channel buffer capacity. This is the only special option we currently have and I do not have other per stream options that I anticipate we set, so I decided to not implement a trait similar to RequestBuilder.

BidiStreamOptions holds a base RequestOptions and request_channel_capacity defaulting to 16, bounded between 1 and MAX_REQUEST_CHANNEL_CAPACITY.

We also provide From conversions between RequestOptions and BidiStreamOptions with user-focused documentation. This enables our users to pass either into the with_options configuration.

For #2318

Add BidiStreamOptions to google_cloud_gax::options to allow customizing
request channel capacity for bidirectional streaming RPCs.
@suzmue
suzmue requested a review from a team as a code owner August 12, 2026 02:23

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces BidiStreamOptions to configure bidirectional streaming RPCs, wrapping standard RequestOptions and adding settings for internal request channel capacity. The feedback suggests defining a public constant DEFAULT_REQUEST_CHANNEL_CAPACITY to avoid magic numbers, and adding fluent builder methods (with_request_channel_capacity and with_request_options) that consume and return self to align with the repository's style guide.

Comment thread src/gax/src/options.rs
Comment thread src/gax/src/options.rs
Comment thread src/gax/src/options.rs
Comment thread src/gax/src/options.rs
Comment thread src/gax/src/options.rs
@suzmue

suzmue commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.26%. Comparing base (2a3e1e0) to head (25def79).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
src/gax/src/options.rs 88.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6341      +/-   ##
==========================================
- Coverage   96.26%   96.26%   -0.01%     
==========================================
  Files         283      283              
  Lines       73110    73160      +50     
==========================================
+ Hits        70380    70428      +48     
- Misses       2730     2732       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…CAPACITY

Define a private DEFAULT_REQUEST_CHANNEL_CAPACITY constant in options.rs set to 16 and use it for BidiStreamOptions default capacity.
@suzmue
suzmue merged commit 3af8399 into googleapis:main Aug 12, 2026
41 checks passed
@suzmue
suzmue deleted the bidi-stream-options branch August 12, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants