You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

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

1.0.1
latest
npm
Version published
Weekly downloads
54
54.29%
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

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