0.0.3 • Published 12 years ago

spigot v0.0.3

Weekly downloads
13
License
-
Repository
github
Last release
12 years ago

Spigot

spigot

This is a javascript library that allows you to queue up as many jobs as you want and process them at a specified concurrency rate.

var Spigot = require('spigot')
  , concurrency = 2 // process 2 jobs at a time (at most)

var spigot = new Spigot(concurrency, function(job, done) {
  console.log(job);
  done();
});

spigot.on('error', function(err, job) {
  console.log('oh noes, error ' + err + ' with job ' + job);
});

spigot.on('empty', function() {
  console.log('all done');
});

spigot.on('done', function(job) {
  console.log('finished job ' + job);
});

for (var i = 0; i < 100; ++i) {
  spigot.queue('meow ' + i);
}
0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago

0.0.0

12 years ago