Created
January 7, 2011 16:48
-
-
Save pgte/769716 to your computer and use it in GitHub Desktop.
setup.js
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
(function setup(how_many, callback) { | |
var successful_ones = 0; | |
for (var i=0; i < how_many; i++) { | |
db.some_call('name', 'value', function(err) { | |
if (err) { callback (err); return; }; | |
successful_ones ++; | |
if (successful_ones == how_many) { | |
callback(); | |
} | |
}); | |
} | |
})(3, callback); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment