Skip to content
FutureBlitz

    Install

    Import std.concurrent.tasks

    WhenAll

    std.concurrent.tasks

    function

    Public Function WhenAll<T>(tasks: Task<T>[]): Task<T[]>

    A Task of each task's result, in their order, done once they all are.

    Examples

    Local tasks = [Spawn(Function() => 1 + 1), Spawn(Function() => 2 + 2)]
    Expect(WhenAll(tasks).Wait() == [2, 4])

    std/concurrent/tasks.fb, line 184

    function

    Public Function WhenAll(tasks: Task[]): Task

    A Task that's done once each of the tasks is.

    std/concurrent/tasks.fb, line 187

    function

    Public Function WhenAll<T, E: Error>(tasks: (Task<T> Throws E)[]): (Task<T[]> Throws E)

    A Task of each task's result, in their order, done once they all are; when any throws, it waits for the rest and then throws the error of the first of them, in their order, that threw.

    std/concurrent/tasks.fb, line 206

    function

    Public Function WhenAll<E: Error>(tasks: (Task Throws E)[]): (Task Throws E)

    A Task that's done once each of the tasks is, which throws the first's error, in their order, when any throw.

    std/concurrent/tasks.fb, line 212

    Report an issue with this page or with FutureBlitz on GitHub.