New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ordered-queue

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ordered-queue

Queue with concurrency that starts tasks in order and runs them in parallel.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

ordered-queue.js

Queue with concurrency that starts tasks in order and runs them in parallel.

Build Status Dependency Status codecov

Usage

const OrderedQueue = require('ordered-queue');
const q = new OrderedQueue((str, callback) => {
  console.log(str);
  callback();
}, { concurrency: 10 });

q.push(3, 'fox');
q.push(1, 'quick');
q.push(0, 'the');
q.push(2, 'brown');

// Will print:
//
// the
// quick
// brown
// fox
//

API

new OrderedQueue(worker, [options])

Creates a new ordered queue with given worker and concurrency. This inherits from timequeue, so it will have all properties, methods, and events from it. Only the TimeQueue#push() method is rewritten.

OrderedQueue#push(order, args1, arg2, ..., callback)

order must be an integer that determines the order of the task. The callback is optional, will be called once task finishes if provided. All arguments inbetween will be passed to the worker.

Install

npm install ordered-queue

Tests

Tests are written with mocha

npm test

Keywords

queue

FAQs

Package last updated on 06 Apr 2018

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