Is it possible to define a single proto3 RPC that can have either a streaming response or a unary response? Like when I define the RPC I can make it clear that the stream keyword is optional?
If streaming is requested, then the response content will be streamed back to the client. If streaming is not requested, then a single response with all content will be returned.
There's other options, like defining two separate RPCs for stream vs. no stream or just return a single response within the stream (the client would still need to consider it a streaming API though AFAICT, not sure about the implications there).
What's the right way to get this behaviour?