AsyncStream is a Swift concurrency type that is an asynchronous sequence generated from a closure that calls a continuation to produce new elements.
AsyncStream
is a Swift concurrency type that is an asynchronous sequence generated from a closure that calls a continuation to produce new elements.
AsyncStream
conforms to AsyncSequence
, providing a convenient way to create an asynchronous sequence without manually implementing an asynchronous iterator. In particular, an asynchronous stream is well-suited to adapt callback- or delegation-based APIs to participate with async-await.