Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

async-function-queue

1.0.0 • Public • Published

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

install

npm i async-function-queue

Downloadsweekly downloads

121

version

1.0.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability