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

async-functions-pool

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-functions-pool

Minimal Async Functions Pool Manager

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
140
decreased by-36.07%
Maintainers
1
Weekly downloads
 
Created
Source

Current Version NPM Minified size Github Code Size Downloads/Week Issues License Contributors

NPM

async-functions-pool

Minimal Async Tasks Pool Manager

Usage

// 1. Import module and execute it to create a pool
const pool = require('async-functions-pool')();

// 2. Add functions to the queue. For example:
pool.add(() => fetch('http://someAPI.com/resource/1'));
pool.add(() => fetch('http://someAPI.com/resource/2'));
pool.add(() => fetch('http://someAPI.com/resource/3'));
pool.add(() => fetch('http://someAPI.com/resource/4'));
pool.add(() => fetch('http://someAPI.com/resource/5'));
pool.add(() => fetch('http://someAPI.com/resource/6'));


// 3. Set number of parallel jobs and run!
async function foo(){
  const results = await pool.run(3);
  console.log('All jobs have finished');
}
foo();

FAQs

  • How minimal it is? 25 Lines of code and no dependencies
  • Can it run common sync functions? Yes
  • Which version of Node is required? > 8.0.0 because it uses async/await

Keywords

FAQs

Package last updated on 28 Oct 2018

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