Skip to content

Instantly share code, notes, and snippets.

@j03m
Created December 16, 2013 17:13
Show Gist options
  • Save j03m/7990567 to your computer and use it in GitHub Desktop.
Save j03m/7990567 to your computer and use it in GitHub Desktop.
async no no
var async = require('async');
var operations = [
function player1Mp(callback) {
setTimeout(function(){
console.log("1");
callback('fail', undefined);
}, 400);
},
function player2Mp(callback) {
setTimeout(function(){
console.log("2");
callback('fail', undefined);
}, 400);
},
function player3Mp(callback) {
setTimeout(function(){
console.log("3");
callback('fail', undefined);
}, 400);
},
];
async.parallel(operations, function(err, res) {
console.log(err);
console.log(res);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment