CoPromise

public final class CoPromise<Value> : CoFuture<Value>

A promise to provide a result later.

CoPromise is a subclass of CoFuture that allows to deliver the result. You can set the result to CoPromise only once, other attempts will be ignored.

  • Undocumented

    Declaration

    Swift

    public convenience init()
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func complete<E>(with result: Result<Value, E>) where E : Error
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func success(_ value: Value)
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func fail(_ error: Error)
  • Undocumented

    Declaration

    Swift

    @inlinable
    public func complete(with future: CoFuture<Value>)