'How gRPC supports keyword stream when define a rpc protobuf?
I am new to gRPC and protobuf.
I notice that gRPC use the keyword stream as the filed rule of arguments when defining a service.
But, i can't find any defination of stream in the documents of Protobuf.
How gRPC can use stream as the filed rule?
Solution 1:[1]
stream keyword is defined in https://developers.google.com/protocol-buffers/docs/reference/proto3-spec#service_definition .
see also https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#method .
Solution 2:[2]
The stream concept is specific to gRPC, and is covered in the core concepts documentation of gRPC; the short version is:
rpc Unary(RequestType) returns (ResponseType);
rpc ServerStreaming(RequestType) returns (stream ResponseType);
rpc ClientStreaming(stream RequestType) returns (ResponseType);
rpc Duplex(stream RequestType) returns (stream ResponseType);
// nomenclature: duplex === bidirectional streaming
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Yuki Hashimoto |
| Solution 2 | Marc Gravell |
