asynchronous - How to use parallel async in meteor -
i having 3 functions fetch screenshots, yelp , google data of website.the result of these 3 functions pushed array of subdocuments inserted database.i need increase performance of api.is possible call these functions using parallel async in meteor without using npm module? line of code used shown below
meteor.methods({ insertapart : function(apart){ var google_data = setgoogledata(apart); var screen_captures_data = setscreenshots(apart); var yelp_data = setyelpdata(apart); function setgoogledata(apart) { // code fetch google data } function setscreenshots(apart) { // code fetch screen shots } function setyelpdata(apart) { // code fetch yelp data } var data=[]; data.google = google_data;// setting google data data.screen_captures = screen_captures_data;// setting screen captures data.yelp = yelp_data;// setting yelp data var id = apartments.insert(data); return id; } });
Comments
Post a Comment