Created
April 10, 2013 12:29
-
-
Save wolframkriesing/5354195 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 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