I have a problem rate limiting http.get Api Calls. My goal is to put all apiCalls from every users requests into one queue and rate limit the calls (FIFO). This external API allows x requests every y seconds, and I would like to allow bursts.
I never had any problems with it. It works well even with Meteor, unless I’m using async function. Every time I’m trying to rate limit http.get, I’m getting that “Error: Meteor code must always run within a Fiber”, which means I’ve failed to modify my code for Meteor. Ive tried to wrapasync and what else! Just nothing works.
I’ve watched EventenMind videos, and I basically understand the concept. I just can’t modify this rate limiting function to work. I’m calling it from server side method, and eventually I want to insert the results into database, and view it on client side.
I haven’t found any other solution for rate limiting apicalls app wide, and allow bursts.
Can someone help me modify this existing function to work with http.get, or tell me another way of doing this? I REALLY need some help here
I know this is alot to ask, but I need to learn. Anything helps!
EDIT: I just figured out, that I can actually schedule a basic setTimeout function, and it works just fine. Weird…