Skip to content

Instantly share code, notes, and snippets.

@leanderlee
Created August 25, 2012 00:30
Show Gist options
  • Select an option

  • Save leanderlee/3457903 to your computer and use it in GitHub Desktop.

Select an option

Save leanderlee/3457903 to your computer and use it in GitHub Desktop.
async stack test
var async = require("async");
var generateTask = function (num) {
return function (callback) {
callback(null, 'The number is at ' + num);
}
}
var tasks = [];
for (var i = 0; i < 1000000; i++) {
tasks.push(generateTask(i));
}
async.series(tasks, function (err, result) {
console.log("Done.");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment