1.0.6 • Published 2 years ago

async-promise-pool v1.0.6

Weekly downloads
452
License
-
Repository
-
Last release
2 years ago

npm version CircleCI

Promise Pool

Promise pool is a small, dependency free, library to manage the concurrent resolution of any number of promises. It is particularly useful when the promises are not all available upfront.

Example Usage

const PromisePool = require("async-promise-pool");

// concurrency is the only option for PromisePool and enables you to 
// choose how many promises will run at once
const pool = new PromisePool({ concurrency: 3 });

// elsewhere add functions to the pool that produce promises. We use
// functions here to prevent the promises from immediately executing.
pool.add(() => thingThatReturnsAPromise());

// you can await pool.all to ensure that all promises in the pool are 
// resolved before continuing.
await pool.all();
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.1-1

5 years ago

1.0.1-0

5 years ago

1.0.0

6 years ago