then-queue

1.3.0 • Public • Published

then-queue

a simple asynchronous queue

Build Status Dependency Status NPM version

Installation

npm install then-queue

API

new Queue()

var Queue = require('then-queue');
var q = new Queue();

A fresh queue!

queue.push(item)

Push an item onto the queue

queue.pop() -> Promise Item

Pop an item from the queue

queue.length

Amount of items in the queue (note that this can be negative if pop has been called more times than push).

Events

The length-changed event gets emitted whenever pop or push has been called. You could use it to spawn/kill workers when the length changes.

Readme

Keywords

Package Sidebar

Install

npm i then-queue

Weekly Downloads

681

Version

1.3.0

License

MIT

Last publish

Collaborators

  • nathan7
  • forbeslindesay