logical.poolfunctionno test imports itfunction pool<T, R>(items: readonly T[], width: number, job: (item: T) => Promise<R>): Promise<readonly R[]>Runs job on each item, at most width at a time, and gives the results in the order of the items.
Jobs run a few at a time (commons repoctl 0003-repoctl-sync FR-007): the checks of the libraries are independent reads, so they run in a pool of a fixed width, and their results are in the order of the jobs, whatever order they finished in. A pure function of the jobs it is given.
import { pool } from "./pool.ts";
await pool([3, 1, 2], 2, (n) => Promise.resolve(n * 2)); // [6, 2, 4]logical.poolfunctionno test imports itfunction pool<T, R>(items: readonly T[], width: number, job: (item: T) => Promise<R>): Promise<readonly R[]>Runs job on each item, at most width at a time, and gives the results in the order of the items.
poolfunctionno test imports itfunction pool<T, R>(items: readonly T[], width: number, job: (item: T) => Promise<R>): Promise<readonly R[]>Runs job on each item, at most width at a time, and gives the results in the order of the items.