async-function-queue

Async Function Queue

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
async-function-queue
601.0.08 years ago8 years agoMinified + gzip package size for async-function-queue in KB

Readme

async-function-queue
By Build Status
Simple async function queue.

Install

$ npm install async-function-queue --save

Use

var Queue = require('async-function-queue');

var concurrency = 2;

// create a queue, defining concurrency
var queue = Queue(concurrency);

// push a function that accepts a callback
// as sole argument
queue.push(function(cb) {
  setTimeout(cb, 1000);
});

Events

// Some emitted events

queue.on('entry', function() {
  console.log('starting to execute function');
});

queue.on('exit', function() {
  console.log('finished executing function');
});

queue.on('drain', function() {
  console.log('queue has drained');
});

License

ISC