running a bazillion asynchronous tasks does not work.
dnozay opened this issue · 1 comments
dnozay commented
function test_promise(arg) {
return Promise.resolve(arg).then(function(data) {
console.log(arg, data); return data;
});
}
var q = queue(5);
for (i=1; i<40; i++) { q.defer(test_promise, i); }
q.awaitAll(function(error, results) { console.log(error, results); })
here is the console output:
1 1 VM1308:2
2 2 VM1308:2
3 3 VM1308:2
4 4 VM1308:2
5 5 VM1308:2
Object {defer: function, await: function, awaitAll: function}
not sure why it does the first 5 calls but then stops.
dnozay commented
user error - didn't pass in the callback.