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

async-limiter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-limiter

asynchronous function queue with adjustable concurrency

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.1M
decreased by-18.72%
Maintainers
1
Weekly downloads
 
Created

What is async-limiter?

The async-limiter package is a module that allows you to limit the number of asynchronous operations that are being processed at the same time. This is useful for controlling resource usage and managing load under high-concurrency situations.

What are async-limiter's main functionalities?

Concurrency Limiting

This code sample demonstrates how to use async-limiter to limit the number of concurrent asynchronous tasks. In this example, the concurrency limit is set to 2, meaning only two tasks will be processed at a time.

const Limiter = require('async-limiter');

const t = new Limiter({ concurrency: 2 });

for (let i = 0; i < 10; i++) {
  t.push((cb) => {
    setTimeout(() => {
      console.log('Processed task', i);
      cb();
    }, 100);
  });
}

t.onDone(() => {
  console.log('All tasks processed');
});

Other packages similar to async-limiter

Keywords

FAQs

Package last updated on 20 Nov 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