Skip to content

Commit 71d3728

Browse files
fixup: Add section on backpressure
Signed-off-by: Si Beaumont <[email protected]>
1 parent da20f7d commit 71d3728

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/async-await-proposal.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,17 @@ where RequestStream: AsyncSequence, RequestStream.Element == Echo_EchoRequest
455455
Unfortunately this isn't currently supported by `AsyncSequence`, but it _has_
456456
been called out as a [possible future enhancement][opaque-asyncsequence].
457457

458+
### Backpressure
459+
460+
This proposal makes no attempt to implement backpressure, which is also not
461+
handled by the existing implementation. However the API should not prevent
462+
implementing backpressure in the future.
463+
464+
Since the `GRPCAsyncStream` of responses is wrapping [`AsyncStream`][SE-0314],
465+
it may be able to offer backpressure by making use of its `init(unfolding:)`, or
466+
`AsyncResponseStreamWriter.sendResponse(_:)` could block when the buffer is
467+
full.
468+
458469
[SE-0296]: https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md
459470
[SE-0298]: https://github.com/apple/swift-evolution/blob/main/proposals/0298-asyncsequence.md
460471
[SE-0310]: https://github.com/apple/swift-evolution/blob/main/proposals/0310-effectful-readonly-properties.md

0 commit comments

Comments
 (0)