feat(gax): add BidiStreamOptions for bidirectional streaming - #6341
Conversation
Add BidiStreamOptions to google_cloud_gax::options to allow customizing request channel capacity for bidirectional streaming RPCs.
There was a problem hiding this comment.
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.
|
Corresponding template changes: googleapis/librarian#7246 Generated code using this: https://github.com/googleapis/google-cloud-rust/compare/main...suzmue:google-cloud-rust:bidi-stream-options-showcase?expand=1 |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
…CAPACITY Define a private DEFAULT_REQUEST_CHANNEL_CAPACITY constant in options.rs set to 16 and use it for BidiStreamOptions default capacity.
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_optionsconfiguration.For #2318