Skip to main content
Module

x/better_iterators/mod.ts>ParallelMapOptions

Chainable iterators (sync and async) for TypeScript, with support for opt-in, bounded parallelism
Latest
interface ParallelMapOptions
import { type ParallelMapOptions } from "https://deno.land/x/better_iterators@v1.5.0/mod.ts";

Passing this to the map() function indicates that you want to map values

Properties

parallel: number

The maximum number of map functions to run in parallel. This gives you bounded parallelism so that you don't overwhelm whatever resource you're mapping with. (ex: fetch, exec, write, etc.)

mapper: (t: T) => Promise<Out>

The async mapping function to run in parallel.

optional
ordered: boolean

Should we maintain the input ordering in the output?

This is the least-surprising behavior, but it comes at the cost of potential head-of-line blocking.

Default: true