Gateway · Reliability
Cancellation and slow readers
Keep work owned and buffers bounded without confusing a slow caller with a stalled provider.
A provider can produce text promptly while the application stops reading it. If Gateway keeps buffering everything, memory grows. If it blames the resulting silence on the provider, it misdiagnoses the problem.
The selected design uses bounded buffers, backpressure and explicit ownership to handle this situation.