@lucid-softworks/concurrency-limit
v0.1.0
Published
Run promise-producing tasks with bounded concurrency.
Downloads
187
Maintainers
Readme
@lucid-softworks/concurrency-limit
Run an array of lazy tasks with bounded concurrency while preserving result order.
import { runWithConcurrency } from "@lucid-softworks/concurrency-limit";
const users = await runWithConcurrency(
ids.map((id) => () => fetchUser(id)),
4,
);Task failures reject the returned promise unchanged. Already-running work is not cancelled.
