Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 29 lines (24 sloc) 0.591 kb

Queue - Simple queue engine for Node.js

Install:

npm install mel-queue

Example usage:

var Queue = require('mel-queue');
var q = new Queue();
q.add(function(queue) {
    setTimeout(function() {
        console.log('Action 1 called');
        queue.next(['new_param']);
    }, 200);
});
q.add(function(param, queue) {
    setTimeout(function() {
        console.log('Action 2 called with param = '+param);
        queue.next();
    }, 100);
}, ['default_param']);
q.on('end', function() {
    console.log('Queue ended');
});
q.run();

See test/* for more examples...

Something went wrong with that request. Please try again.