npm install --save queue-async
Created
October 31, 2013 18:47
-
-
Save tmcw/7254836 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queue = require('queue-async'); | |
var q = queue(8); | |
['things'].forEach(function(t) { | |
q.defer(doTask); | |
}); | |
function doTask(thing, callback) { | |
// do stuff with this and then | |
callback(null, result); | |
} | |
q.awaitAll(function(err, results) { | |
// this is called after all done | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment