-
Notifications
You must be signed in to change notification settings - Fork 349
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: Streaming support #373
Conversation
It still won't compile, but this at least makes the class match the interface.
If you define a single streaming RPC (client, server or bidirectional streaming), the Rpc interface will require you to also implement clientStreaming, serverStreaming and bidirectionalStreaming. Those methods will be passed/return Observables. Previously, the generated file when using streaming RPCs did not compile.
With the ts-proto support from stephenh/ts-proto#373
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Jille ! Thanks for the PR! I haven't personally done a lot of streaming, so contributions to flush this out is great. Looks like maybe its just prettier failing the CI checks, but otherwise lgtm!
Thanks @stephenh! There seems to be one other weird thing from the CI: https://github.com/stephenh/ts-proto/runs/4037980567?check_suite_focus=true - It rewrites integration/grpc-web-go-server/example.ts and integration/no-proto-package/no-proto-package.ts and eats all the indentation. I don't see how that'd be caused by my PR, is it a known issue? |
@Jille ah yeah, those errors can be hard to debug; there is a likely-silly syntax error, which means that the last "run prettier to get nice indentation" step can't run, and so you're seeing the raw ts-proto output. Maybe try running |
This fixes broken generated code that somehow didn't happen for all tests but only a few.
Thanks, that was the hint I needed :) |
Looks good @Jille ! Going to hit merge and should be auto-released. |
# [1.85.0](v1.84.0...v1.85.0) (2021-11-02) ### Features * Streaming support ([#373](#373)) ([459b94f](459b94f))
🎉 This PR is included in version 1.85.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I just went ahead and implemented my proposal from #372.
This should make it possible to do streaming RPCs, given that the user's Rpc implementation implements a few extra methods.
Not sure why the Reader/Writer order was changed in the generated files. I'm assuming it's because I changed some calling order, but I didn't investigate.