🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

queue-ts

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

queue-ts

A promise based worker queue with limited concurrency

0.1.0
latest
Source
npm
Version published
Weekly downloads
71
7.58%
Maintainers
1
Weekly downloads
 
Created
Source

queue-ts

GitHub license Travis Coveralls branch David David npm Commitizen friendly

A promise based worker queue with limited concurrency.

Usage

// Create a queue with two worker threads
const queue = new Queue(2);
queue.onEmpty(() => {
  console.log('done');
});

// Adding tasks to do
queue.add(function task1() {});
queue.add(function task2() {});
queue.add(function task3() {});
queue.add(function task4() {});
queue.add(function task5() {});

The scheduled tasks will be executed but at most queue.concurrency task will be executed in parallel.

FAQs

Package last updated on 16 Apr 2016

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