UNPKG

@altano/tiny-async-pool

Version:

Run multiple promise-returning & async functions with limited concurrency using native ES9

21 lines 726 B
import { type IterableItem } from "./doWorkAndYield.js"; /** * Process items from `iterable` in batches. */ export declare function doWork<TIn, TIterable extends Iterable<TIn>>( /** * The size of the batch of work, or, how many times `iteratorFn` will be * called in parallel. */ concurrentCount: number, /** * An iterable that contains the items that should be passed to `iteratorFn`. */ iterable: TIterable, /** * The async callback function that does the work. Will be passed items from * `iterable`. Promise returned must not resolve to a value, as it will be * ignored. */ iteratorFn: (item: IterableItem<TIterable>, Iterable: TIterable) => Promise<void>): Promise<void>; //# sourceMappingURL=doWork.d.ts.map