promotion
Powerful debugging in Xcode,
no code changes or 3rd party frameworks required.

Bridge from Combine to AsyncSequence - the code (p. 2)

Yesterday I wrote about AsyncSequence, AsyncStream and a simple plan how to bridge (or proxy) Combine publishers to the new asynchronous sequences APIs - Bridge from Combine to AsyncSequence - the plan (part 1). Today let’s put together the code as planned and see if that’s going to work out so we can easily use publishers as async sequences. CombineAsyncStream setup I’ll create a new type called CombineAsyncStream and make it conform to AsyncSequence. …

Posted on

Bridge from Combine to AsyncSequence - the plan (p. 1)

Previously, I wrote about actors in Actors part 1 and Actors part 2; this time I’m going to cover how to write a Combine operator to proxy a Combine publisher into an async sequence that you can iterate over by using a simple for loop. Note: The current version of Xcode 13 is beta 2 and I’m going to be using the latest swift.org toolchain nightly snapshot in order to make use of AsyncStream. …

Posted on