Deferred

public struct Deferred<Value>

A value that may become determined (or filled) at some point in the future. Once determined, it cannot change.

You may subscribe to be notified once the value becomes determined.

Handlers and their captures are strongly referenced until:

  • they are executed when the value is determined
  • the last copy to this type escapes without the value becoming determined

If the value never becomes determined, a handler submitted to it will never be executed.

  • Declaration

    Swift

    public init()
  • Creates an instance resolved with value.

    Declaration

    Swift

    public init(filledWith value: Value)
  • Declaration

    Swift

    public func upon(_ executor: Executor, execute body: @escaping(Value) -> Void)
  • Declaration

    Swift

    public func peek() -> Value?
  • Declaration

    Swift

    public func wait(until time: DispatchTime) -> Value?
  • Declaration

    Swift

    @discardableResult
    public func fill(with value: Value) -> Bool
  • Declaration

    Swift

    public typealias Success = Value.Right