Skip to content

Instantly share code, notes, and snippets.

@wolframkriesing
Created April 10, 2013 12:29
Show Gist options
  • Save wolframkriesing/5354195 to your computer and use it in GitHub Desktop.
Save wolframkriesing/5354195 to your computer and use it in GitHub Desktop.
var async = require('async');
async.parallel([
function(callback){
callback(null, 'one');
},
function(callback){
setTimeout(function() {callback(new Error('ONE'));}, 0);
},
function(callback){
setTimeout(function() {callback(null, 'long');}, 0);
},
function(callback){
callback(null, 'two');
},
function(callback){
callback(new Error('TWO'));
}
],
// optional callback
function(err, results){
console.log(err, results);
// logs [Error: TWO] [ 'one', , , 'two', undefined ]
// shouldnt it be: [Error: TWO] [ 'one', undefined, 'long', 'two', undefined ]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment