Skip to content

Conversation

@summer-ji-eng
Copy link
Contributor

Implement sample code for Stream.Bidi

   * try (EchoClient echoClient = EchoClient.create()) {
   *   BidiStream<EchoRequest, EchoResponse> bidiStream =
   *       echoClient.chatCallable().call();
   *
   *   EchoRequest request = EchoRequest.newBuilder().build();
   *   bidiStream.send(request);
   *   for (EchoResponse response : bidiStream) {
   *     // Do something when receive a response
   *   }
   * }

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 6, 2021
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Jan 6, 2021
@summer-ji-eng summer-ji-eng force-pushed the stream_bidi_sample_code branch from 5a2cfa8 to a14cc0a Compare January 8, 2021 01:06
@summer-ji-eng summer-ji-eng changed the title [samplecode][3/3]Implement Stream.Bidi sample code [samplecode][2/3]Implement Stream.Bidi sample code Jan 8, 2021
Copy link
Contributor

@miraleung miraleung left a comment

Choose a reason for hiding this comment

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

LGTM with comments addressed.

// Create bidi stream variable expression and assign it with invoking client's bidi stream
// method.
// e.g. BidiStream<EchoRequest, EchoResponse> bidiStream = echoClient.chatCallable().call();
TypeNode bidiStreamType =
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this method is already named bidi, do the variable names still need bidi in them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used bidiStream to match the original sample code syntax, but I am open to the variable name. A stream variable in server is stream, so I think it make sense use stream instead of bidiStream. Are you also preferring using stream instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's for matching the variable name, then bidiStream LGTM.

Base automatically changed from stream_server_sample_code to samplecode-master January 11, 2021 23:57
// Create bidi stream variable expression and assign it with invoking client's bidi stream
// method.
// e.g. BidiStream<EchoRequest, EchoResponse> bidiStream = echoClient.chatCallable().call();
TypeNode bidiStreamType =
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's for matching the variable name, then bidiStream LGTM.

@summer-ji-eng summer-ji-eng merged commit 897dcb8 into samplecode-master Jan 12, 2021
@summer-ji-eng summer-ji-eng deleted the stream_bidi_sample_code branch January 12, 2021 07:54
suztomo added a commit that referenced this pull request Mar 21, 2023
While updating multiple dependencies in the BOM, it's ok to have inconsistent versions. But we want to ensure the consistent versioning when we make a release of the BOM.

I copied the setting from https://github.com/googleapis/java-cloud-bom/blob/main/.github/workflows/full-convergence-check.yaml#L10
suztomo pushed a commit that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants