Combine • It provides a declarative Swift API for processing values over time • These values can represent many kinds of asynchronous events • Customise handling of asynchronous events by combining event-processing operators
Publisher • emit sequence of values over time • delivers values to one or more Subscriber instances • protocol with two generic types (Output, Error) • completion via .finished or .failure
Subscriber • receive emitted values from a Publisher • represents end of the chain of a stream • protocol with two generic types (Input, Error) • can cancel a subscription • Sink, Assign, AnySubscriber
• `receive(on:)` affects downstream events • `subscribe(on:)` affects upstream events • In the example, requests to `$queryPublisher` are performed on `backgroundQueue`, but elements received from it are performed on `Dispatch.main` Threading