Swift Async Algorithms Proposal: Broadcast (Previously Shared)

I agree, progress on asynchronous sequences does appear to have slowed down somewhat.

I don't have any particular insights into why, but my guess would be that we're dependent on decisions in other areas of the language before AsyncSequence can really get into a good shape. For example, a decision on typed throws will determine the shape of a protocol for production side of an AsyncSequence – an AsyncSource or whatever it ends up being called. It would also allow for primary associated types to be locked-in for AsyncSequence, or failing that whether a stop-gap AnyAsyncSquence type should have 1 generic parameter, or include a 2nd parameter for a typed error.

More widely, I'm not sure asynchronous sequences can ever be a complete replacement for Combine as the focus for asynchronous sequences is decidedly on the asynchronous part. Probably quite rightly, It's very hard to wrestle Swift concurrency into acting synchronously as has been discussed quite extensively on the Observable proposal.

Maybe, Observable will eventually fill much of this particular gap, but that remains to be seen.

1 Like