So Future is a publisher designed for one time async work. You give it a block of code to execute, inside that block you do whatever async work you need — a network call, a database read, anything — and when that work finishes you call promise(.success(value)) if everything went well or promise(.failure(error)) if something went wrong. That result then gets pushed down the pipeline into the subscriber which receives the value in receiveValue or handles the failure in receiveCompletion. The two generic types on Future<OutputType, ErrorType> just define what type of value it will emit and what type of error it can throw, and if it can never fail you just use Never as the error type. So basically Future is Combines way of wrapping any one time async operation into a publisher so it fits cleanly into your Combine pipeline.

Concept

A publisher is the source of data in Combine.

Publishers emit values over time and send those values to subscribers through a Combine pipeline.

Conceptually:

Publisher → Operators → Subscriber

The publisher is responsible for:

producing values
sending completion events
managing the subscription lifecycle

Every Combine pipeline begins with a publisher.


Publisher Lifecycle

When a subscriber attaches to a publisher, the following sequence occurs:

subscriber attaches
↓
subscription created
↓
publisher emits values
↓
subscriber receives values
↓
publisher sends completion

This lifecycle is common to all Combine publishers.


Example Publishers

The PublishersViewController demonstrates three different types of publishers:

Just
Sequence publisher
Future

Each represents a different type of data source.