---
source: https://iinventedlight.com/library/notes/grpc-streaming.md
title: "Define a streaming gRPC method in a Protocol Buffer service"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (gRPC); BSD-3-Clause (Protocol Buffers); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: gRPC, Core concepts; Protocol Buffers, Language Guide (proto3). CC-BY-4.0; BSD-3-Clause."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: gRPC streaming RPCs and Protocol Buffer services"
tags: [grpc, protobuf, streaming, rpc]
client: Librarian
sources:
  - id: S1
    title: "Core concepts"
    publisher: gRPC
    url: https://grpc.io/docs/what-is-grpc/core-concepts/
    accessed: 2026-11-19
    license: "CC-BY-4.0"
  - id: S2
    title: "Language Guide (proto3)"
    publisher: Protocol Buffers
    url: https://protobuf.dev/programming-guides/proto3/
    accessed: 2026-11-19
    license: "BSD-3-Clause"
---
# Define a streaming gRPC method in a Protocol Buffer service
**Answer:** gRPC has unary RPCs and three streaming kinds: server streaming, client streaming, and bidirectional streaming. You define the service interface in a `.proto` file. The most straightforward RPC system to use with Protobuf is gRPC.

## Streaming RPCs

In a server-streaming RPC, the client sends a request to the server and reads a sequence of messages back, until there are no more messages. In a client-streaming RPC, the client writes a sequence of messages, then waits for the server to return its response. In bidirectional streaming, both sides send a sequence of messages. The two streams operate independently. gRPC guarantees message ordering within an individual RPC call.

## Services in proto3

If you want to use your message types with an RPC system, define an RPC service interface in a `.proto` file. The Protobuf compiler will generate service interface code and stubs. The example is `service SearchService` with `rpc Search (SearchRequest) returns (SearchResponse)`. The gRPC page writes `returns (stream HelloResponse)` for server streaming.

| RPC kind | stream |
|---|---|
| server streaming | Server returns a stream of messages |
| client streaming | Client writes a sequence of messages |
| bidirectional streaming | Both sides send on a read-write stream |
| .proto service | RPC interface compiled to stubs |

## See also

- [http-status-codes](https://iinventedlight.com/library/notes/http-status-codes/)
- [fastapi-async-await](https://iinventedlight.com/library/notes/fastapi-async-await/)
- [django-request-response](https://iinventedlight.com/library/notes/django-request-response/)

## Claims

- id: C1
  claim: gRPC supports server streaming, client streaming, and bidirectional streaming RPCs.
  source: S1
  evidence: "gRPC guarantees message ordering within an individual RPC call"

- id: C2
  claim: A server-streaming RPC returns a stream of messages in response to a client's request.
  source: S1
  evidence: "the server returns a stream of messages in response to a client’s request"

- id: C3
  claim: A .proto file can define an RPC service interface that gRPC compiles to stubs.
  source: S2
  evidence: "The most straightforward RPC system to use with Protobuf is gRPC"

## Sources

- [S1] Core concepts. gRPC. https://grpc.io/docs/what-is-grpc/core-concepts/ . License: CC-BY-4.0. Accessed 2026-11-19.

- [S2] Language Guide (proto3). Protocol Buffers. https://protobuf.dev/programming-guides/proto3/ . License: BSD-3-Clause. Accessed 2026-11-19.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: gRPC, Core concepts; Protocol Buffers, Language Guide (proto3). CC-BY-4.0; BSD-3-Clause. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
