@vgerbot/async
    Preparing search index...

    Variable allConst

    all: (
        options: ParallelOptions,
        ...tasks: AsyncTask<unknown>[],
    ) => CancellableHandle<unknown[]> = parallel

    Alias for parallel. Executes tasks concurrently and resolves when all succeed, or rejects when any fail.

    Type Declaration

      • (
            options: ParallelOptions,
            ...tasks: AsyncTask<unknown>[],
        ): CancellableHandle<unknown[]>
      • Executes an array of tasks concurrently, with an optional concurrency limit. Resolves with an array of results in the same order as the input tasks. If any task rejects, the entire operation rejects.

        Parameters

        • options: ParallelOptions

          Configuration options, including cancellation token and concurrency limit.

        • ...tasks: AsyncTask<unknown>[]

          The tasks to execute.

        Returns CancellableHandle<unknown[]>

        A cancellable handle that resolves with the array of task results.

        const handle = parallel(
        { concurrency: 2 },
        async (token) => {
        await token.sleep(30);
        return "A";
        },
        async (token) => {
        await token.sleep(10);
        return "B";
        },
        );

        const result = await handle; // ["A", "B"]
    const handle = all(
    { concurrency: 2 },
    async () => 1,
    async () => 2,
    );
    const result = await handle; // [1, 2]