connectrpc / connect-go

The Go implementation of Connect: Protobuf RPC that works.
https://connectrpc.com
Apache License 2.0
2.9k stars 96 forks source link

Support streaming? #1

Closed akshayjshah closed 3 years ago

akshayjshah commented 3 years ago

Right now, reRPC only exposes support for unary RPCs. However, it wouldn't be terribly difficult to support client, server, and bidirectional streaming - under the hood, NewReflectionHandler already uses bidi streaming.

Advantages of streaming:

Disadvantages of streaming:

I lean toward keeping reRPC unary-only, but I'm leaving this issue open for discussion. I'm particularly interested in talking to anyone willing to use reRPC streaming in production.

akshayjshah commented 3 years ago

Pushed a bit more progress tonight: we're now generating the server-side code to support all three streaming RPC types. Hopefully I'll get the client-side code and tests done in the next few days.

akshayjshah commented 3 years ago

Done! reRPC now supports client, server, and bidirectional streaming, and cross-tests show that we're compatible with grpc-go. (We should probably exercise more corner cases in tests, though.)

Adding streaming didn't expand the API as much as I feared. We needed:

I'm still pretty close to the code, but the APIs feel pretty narrow to me.