[Pitch] New APIs for Async[Throwing]Stream with backpressure support

AsyncChannel can only provide backpressure between two Swift Tasks. If you are producing from a non-async context then it cannot be used. This is because AsyncChannel.send is async. This is not true of AsyncStream.Continuation or this proposal here, which can both be used from non-async contexts.

Additionally, AsyncChannel has an effective internal buffer size of 1: a call to send suspends until the value is dequeued from next. That's not always optimal.

3 Likes