-
Notifications
You must be signed in to change notification settings - Fork 97
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
Client side support for http streaming #5506
Conversation
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.
How does this work in terms of the proto API? Will this let us write streaming RPC methods now or is there some additional codegen support needed? (IIRC the protobufjs codegen doesn't generate code for streaming APIs?)
Here's an example:
We could probably do something fancy to make this nicer, but I don't think this is so bad. |
app/service/rpc_service.ts
Outdated
while (true) { | ||
let result = await reader?.read(); | ||
if (result?.done) { | ||
break; |
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.
should this be return
? Seems like we'll do another fetch
after this break
, guessing that's not intended?
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.
Good catch, I am struggling with return
s today lol.
I tested this a bunch without the fallback case at the bottom - and then added the fallback to support hiding this behind a flag, and guess I didn't notice the extra fetch.
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.
Fixed
Client side support for server-side grpc streaming over http.
This is behind a
app.streaming_http_enabled
flag.If that flag is enabled, we'll do three things:
application/proto
toapplication/grpc+proto
Length-Prefixed-Message
s (see https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md)There is a TODO in there to support messages that come across chunks. This should be relatively straightforward to implement, but I haven't run into it in my testing - and would like to run into it before fixing.
Depends on: #5505