Skip to main content
Module

std/async/mod.ts>pooledMap

Deno standard library
Go to Latest
function pooledMap
import { pooledMap } from "https://deno.land/std@0.80.0/async/mod.ts";

pooledMap transforms values from an (async) iterable into another async iterable. The transforms are done concurrently, with a max concurrency defined by the poolLimit.

Parameters

poolLimit: number

The maximum count of items being processed concurrently.

array: Iterable<T> | AsyncIterable<T>

The input array for mapping.

iteratorFn: (data: T) => Promise<R>

The function to call for every item of the array.

Returns

AsyncIterableIterator<R>