Unbounded stream consumers eventually fail in one of three ways: memory pressure, queue thrashing, or timeout amplification.
Core Rule
Apply backpressure at every stage, not just network transport.
// Bounded application channel protects process memory.
msgs := make(chan *pb.Event, 1024)Implementation Notes
- Tune HTTP/2 window sizes with realistic payloads.
- Use bounded worker pools for downstream processing.
- Propagate cancellation aggressively.
Throughput without backpressure is borrowed time.