Best way to collect the results of multiple async calls?


#1

I’m familiar with Meteor.async() and the meteorhacks async package. But I could not find a best practice to collect the results of multiple async calls in a sync way. In my use-case, I would like to download a couple of images on server-side in parallel, and continue execution once all these download threads have finished downloading. I remember I read that Promises come in handy here. But I’m not sure if that’s the right direction to look for a solution.


#2

That reminded me of this guys thread Error with meteor.com deployed app


#3

https://github.com/caolan/async will do the job.


#4

This may be of interest. It uses the deprecated Meteor.http syntax (replace with HTTP), but does show you one way to do this in Meteor.


#5

Thanks guys for your input!

BTW: Do you happen to know if Node.js has a certain limit for the number of parallel HTTP requests on server-side?