Advanced Swift Concurrency: AsyncStream
There is a lot to understand in Swift Concurrency. You’ll immediately feel the benefits of async/await syntax to squash your nested maze of completion blocks down to linear, readable APIs across your entire codebase. Once you grasp the basics, you’ll pick up async let, task groups, and the mighty Task to unlock the powers of parallelisation, priority, and propagation (of cancellation through a hierarchy*). With so many language features to get to grips with, you might have never applied powerful advanced tools like AsyncStream.
That ends today. We’re going through 3 real-world applications of AsyncStream to develop an intuition for how & when to apply it. My lazier paid subs can also just copy-paste my sample project—knock yourselves out.
Continue reading this post for free in the Substack app |