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

update client stream to receive and return server response #231

Closed

Conversation

asutula
Copy link

@asutula asutula commented May 23, 2020

It is typical for grpc client streams to receive a final response from the server after ending the client stream. This wasn't implemented in ts-protoc-gen as described and exemplified in #105. This PR fixes that.

Changes

  • Updated code generation for client stream (RequestStreams) onEnd callbacks to take an additional resp: ResT | undefined parameter to which the server response can be passed.
  • Updated generated grpc client code to get the server response and pass it to the onEnd listeners.
  • Updated the generated Typescript definitions to reflect all this
  • Generated example/test code in the repo so it reflects these changes
  • Added a test to test these changes

Verification

Added a test in the client streaming tests that specifies the mock grpc transport return a message, and verifies that message was received.

Signed-off-by: Aaron Sutula <hi@asutula.com>
Signed-off-by: Aaron Sutula <hi@asutula.com>
Signed-off-by: Aaron Sutula <hi@asutula.com>
Signed-off-by: Aaron Sutula <hi@asutula.com>
Signed-off-by: Aaron Sutula <hi@asutula.com>
@stale
Copy link

stale bot commented Aug 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant