Contents

AsyncThrowingPublisher

A publisher that exposes its elements as a throwing asynchronous sequence.

Declaration

struct AsyncThrowingPublisher<P> where P : Publisher

Overview

AsyncThrowingPublisher conforms to AsyncSequence, which allows callers to receive values with the for-await-in syntax, rather than attaching a Subscriber. If the upstream publisher terminates with an error, AsyncThrowingPublisher throws the error to the awaiting caller.

Use the values property of the Publisher protocol to wrap an existing publisher with an instance of this type.

Topics

Creating an asynchronous publisher

Creating an iterator

Supporting types

See Also

Asynchronous Publishers