Generic Class

Future

A publisher that eventually produces a single value and then finishes or fails.

Declaration

final class Future<Output, Failure> where Failure : Error

Topics

Creating a Future

init((@escaping Future<Output, Failure>.Promise) -> Void)

Creates a publisher that invokes a promise closure when the publisher emits an element.

typealias Future.Promise

A type that represents a closure to invoke in the future, when an element or error is available.

Instance Methods

func max() -> Publishers.Comparison<Future<Output, Failure>>
func min() -> Publishers.Comparison<Future<Output, Failure>>
func switchToLatest() -> Publishers.SwitchToLatest<Output, Future<Output, Failure>>

Relationships

Conforms To

See Also

Convenience Publishers

struct Just

A publisher that emits an output to each subscriber just once, and then finishes.

Beta
struct Deferred

A publisher that awaits subscription before running the supplied closure to create a publisher for the new subscriber.

Beta
struct Empty

A publisher that never publishes any values, and optionally finishes immediately.

Beta
struct Fail

A publisher that immediately terminates with the specified error.

Beta
struct Record

A publisher that allows for recording a series of inputs and a completion, for later playback to each subscriber.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software