BlockingExecutor

public protocol BlockingExecutor : ExecutorProtocol

A protocol that defines an object that can synchronously drive futures to completion and can be waited on until it’s empty.

Blocking executors must explicitly be asked to run, using the run() method, to actually perform work.

  • run() Extension method

    Runs the executor until all possible progress is made and returns a boolean denoting whether all submitted futures executed to completion.

    If this method returns false, indicating that the executor has still pending futures, you must call this method again some time in the future to ensure the futures tracked by the executor are driven to completion.

    Declaration

    Swift

    @discardableResult
    @inlinable
    public func run() -> Bool
  • runUntil(_:) Extension method

    Runs the executor until the given future completes.

    Declaration

    Swift

    @inlinable
    public func runUntil<F>(_ future: F) -> F.Output where F : FutureProtocol
  • wait() Extension method

    Runs the executor until all submitted futures complete, blocking the current thread waiting for futures to become ready if no further progress can be made.

    Executor implementations must guarantee that when this method returns, the executor has run all submitted futures to completion and is empty.

    Declaration

    Swift

    @inlinable
    public func wait()