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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -