Skip to content
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

feat(gengapic): regapic server-streaming #933

Merged
merged 5 commits into from
Mar 22, 2022

Conversation

noahdietz
Copy link
Collaborator

This adds support for REGAPIC Server Stream RPCs. Since server-stream RPCs in GAPICs must return the gRPC-defined, RPC-specific "stream client" interface, we must implement that interface around the HTTP-JSON stream (the Response Body) opened by the HTTP-JSON request. An RPC-specific implementation of that stream client interface is generated in the GAPIC that utilizes the gax.ProtoJSONStream helper to decode the stream contents into the proto messages. The behavior of this generated stream client is the same as documented by the gRPC-defined interface.

When the stream is done/closed, io.EOF is returned.

If the context.Context used to initialize the stream is canceled, the invocations of Recv fail.

When the stream is finished or in the event of an error, the gax.ProtoJSONStream is closed by the generated stream client.

@noahdietz noahdietz requested review from a team as code owners March 16, 2022 21:20
@noahdietz noahdietz requested a review from summer-ji-eng March 16, 2022 21:21
@noahdietz noahdietz requested a review from codyoss March 17, 2022 23:24
@noahdietz
Copy link
Collaborator Author

I regenerated the Firestore client with these changes and with REST transport generation enabled. I was then able to successfully consume a RunQuery REST stream.

@noahdietz noahdietz merged commit a6c0c81 into googleapis:main Mar 22, 2022
@noahdietz noahdietz deleted the regapic-server-stream branch March 22, 2022 18:04
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