🔌 gRPC Beginner

What is client streaming RPC?

Answer

Client streaming RPC allows the client to send a stream of multiple request messages to the server, which processes them and returns one response after the client closes the stream. Defined as: rpc UploadSensorData(stream SensorReading) returns (UploadSummary);. The client sends messages one by one, then closes the stream. The server reads all messages, accumulates them, and returns a single summary response. Use cases: file uploads sent in chunks (the server assembles them), aggregating time-series data (the server computes statistics after receiving all readings), batch operations (the client streams many records, the server processes and confirms). The server waits until the client closes its sending stream before sending its response.