New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

basic-queue

Package Overview
Dependencies
Maintainers
30
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basic-queue

a basic queue with concurrency

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
Maintainers
30
Weekly downloads
 
Created
Source

basic-queue

example

var Queue = require('basic-queue');
var q = new Queue(request, concurrency / numWorkers);

function request() {
    q.add();
}

api

q = Queue(callback, concurrency)

callback is the function that this queue runs. Concurrency is how many simultaneous jobs should run of that function. callback will receive object and callback as arguments. If callback is a call with an error as a first argument, the queue will emit an error event.

q.add()

Tell the queue to start a new job if it isn't over the concurrency limit.

Keywords

queue

FAQs

Package last updated on 16 Jan 2015

Related posts