Socket
Socket
Sign inDemoInstall

basic-queue

Package Overview
Dependencies
0
Maintainers
30
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    basic-queue

a basic queue with concurrency


Version published
Weekly downloads
117
decreased by-31.98%
Maintainers
30
Install size
4.17 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 16 Jan 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc