Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 980
gao yuan Avatar asked Oct 16 '25 21:10

gao yuan


1 Answers

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
like image 91
Marc Gravell Avatar answered Oct 19 '25 19:10

Marc Gravell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!