(no title)
dc-tech-fan | 13 years ago
Use a library like Async, it makes this really easy.
https://github.com/caolan/async
(assume redis, mongo, facebook, and callback are all functions)
async.parallel([ redis, mongo, facebook], callback);
callback is called when all of the others are complete. If you have dependencies, like facebook needs the output of redis and mongo then use async.auto which will automatically run things in parallel and in the order you need them.
mcs|13 years ago
anonymoushn|13 years ago