Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-promise-pool

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-promise-pool

A flexible pool of promises that can be awaited and executed at a chosen level of concurrency

  • 1.0.6
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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();

FAQs

Package last updated on 07 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc