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

promise-pool-ext

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-pool-ext

Queue promises into pool limiting concurrency

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
371
decreased by-57.7%
Maintainers
1
Weekly downloads
 
Created
Source

promise-pool-ext

Build Status Test Coverage Dependabot Status Dependencies NPM Downloads Semantic-Release Gardener

Queue promises into pool limiting concurrency

Install

Install with npm:

$ npm install --save promise-pool-ext

Usage

const { Pool } = require('promise-pool-ext');

const pool = Pool({ concurrency: 10 });

// queue array of functions, returns Promise < array of function results >
pool([
  () => new Promise((resolve) => { /* do async logic here */ }),
  async () => { /* do async logic here */ }
]);

// queue function, returns Promise < function result >
pool(async () => { /* do async logic here */ });

Errors

When a promise is rejected or an error is thrown, the returned promise is rejected once all promises in batch have completed execution.

Why

As an example, when making a lot of external requests one can hit limits of the external API or the node runtime itself. This library makes it easy to limit the amount of parallel executions.

Keywords

FAQs

Package last updated on 13 Dec 2019

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