gRPC streaming lets one call exchange multiple messages over time instead of pairing one request with one response. It supports server streaming, client streaming, and bidirectional streaming, alongside ordinary unary calls. section 4.8.1
Choose the streaming direction according to which side produces multiple messages:
- Unary sends one request and returns one response. section 4.8.1
- Server streaming returns multiple responses for one request. section 4.8.1
- Client streaming sends multiple requests during one call. section 4.8.1
- Bidirectional streaming allows both sides to send multiple messages. section 4.8.1
Streaming inventory updates
An inventory service can accept several cars over one connection and return a response for each car. Declare the RPC as `rpc add(stream InsertCarRequest) returns (stream CarResponse) {}`. In Quarkus, represent incoming and outgoing messages with Mutiny `Multi` values. Map each request to a `Car`, persist it, and map that model to a `CarResponse`. Because database I/O is blocking, annotate the method with `@Blocking` rather than running it on the event-loop thread. section 8.4.2
