What's an effective method to make 50 API requests at a time when there is a limit of 10 calls per second (Rotten Tomatoes API)?
问题 I have an application which has to make 50 to 100 API calls in a loop. Rotten Tomatoes have a limit of 10 calls per second. As a result of this my requests fail in between and i get different results everytime. What is an effective way to make these 50 requests without exceeding the 10 reqs/per second limit ? Here's my code: $.each(elem, function (index, item) { var $placeholder = $('<div>').appendTo("div.content"); $.ajax({ type: 'post' , url: moviesSearchUrl + '&q=' + encodeURI(item) + '