drainer-parallel

0.1.0 • Public • Published

drainer-parallel

Queue and drain an array of functions in parallel. This is a related module to drainer

Install

npm install drainer-parallel --save

Usage

var drainer = require('drainer-parallel');
 
var queue = [
  function (done) {
    setTimeout(function () {
      done();
    }, 100);
  },
  function (done) {
    // do something
    done();
  }
];
 
var drainer(queue, function (err) {
  // All done
});

Handling Errors

Each function in the array recieves a callback, done(), to call when function in queue is complete. If you provide an argument to this callback, it will be passed into an array of errors that is passed to the final callback.

The finally callback will be called once all the items in the queue have been drained.

Run Tests

npm install
npm test

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i drainer-parallel

    Weekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • scottcorgan