Array

extension Array where Element: Task

Available where Element: Task

  • Executes each task in this array and returns an array of Results in the completion block

    SeeAlso: Task.async(...) for the rest of the parameters

    Declaration

    Swift

    @discardableResult
    public func async(
        using taskManager: TaskManager? = nil,
        inOrder: Bool = false,
        after interval: DispatchTimeInterval? = nil,
        queue: DispatchQueue? = nil,
        timeout: DispatchTimeInterval? = nil,
        completion: ((Result<[Result<Element.SuccessValue, Error>], Error>) -> Void)? = nil
    ) -> Handle

    Parameters

    inOrder

    true if you want the tasks executed strictly one after the other

  • Executes each task in line and awaits an array of each tasks’ result

    SeeAlso: Task.await(...) for the rest of the parameters

    Declaration

    Swift

    public func await(
        using taskManager: TaskManager? = nil,
        inOrder: Bool = false,
        timeout: DispatchTimeInterval? = nil
    ) throws -> [Result<Element.SuccessValue, Error>]

    Parameters

    inOrder

    true if you want the tasks executed strictly one after the other

  • Executes each task in line and awaits an array of each tasks suceess result If none of the tasks succeed or there’re no tasks anyway then an empty array will be returned

    SeeAlso: Task.await(...) for the rest of the parameters

    Declaration

    Swift

    public func awaitSuccess(
        using taskManager: TaskManager? = nil,
        inOrder: Bool = false,
        timeout: DispatchTimeInterval? = nil
    ) -> [Element.SuccessValue]

    Parameters

    inOrder

    true if you want the tasks executed strictly one after the other