After much research, I'm not sure what the best practice is, is my following idea decent?
I want to access an API that limits the total number of calls I can make to 50 per minute.
My program has multiple threads operating on their own.
How can I limit my program to stay below the threshold?
My idea is to create a queue, and add one thing to it every X seconds where X = thread_count/allowed_calls*60. Then a separate thread would be needed for handling these requests. (And a separate thread for adding at a regular interval)
What would the best practice be for something like this? Is there a way to achieve this without needing completely separate threads for each little functionality?