Skip to content

Instantly share code, notes, and snippets.

@joeLepper
Created January 11, 2014 00:23
Show Gist options
  • Save joeLepper/8365264 to your computer and use it in GitHub Desktop.
Save joeLepper/8365264 to your computer and use it in GitHub Desktop.
parallel example
var timer = require('timers')
, result = 0
, iter = 0;
var A = function(){
var B = function(callback){
callback(50);
}
var C = function(callback){
callback(25);
}
B(execute);
C(execute);
}
function execute(data){
result += data;
if (!iter){
iter++
return
}
console.log(result);
}
A();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment