Skip to main content
Module

x/better_iterators/mod.ts>LazyAsync#mapPar

Chainable iterators (sync and async) for TypeScript, with support for opt-in, bounded parallelism
Go to Latest
method LazyAsync.prototype.mapPar
import { LazyAsync } from "https://deno.land/x/better_iterators@v1.2.1/mod.ts";

Like map, but performs up to max operations in parallel.

Note: This function will ensure that the order of outputs is the same as the order of the inputs they were mapped from. This can introduce head-of-line blocking, which can slow performance. If you don't need this, use mapParUnordered instead.

Parameters

max: number
transform: Transform<T, Promise<Out>>