I have a problem, which from my perspective is some kind of special.
Iam running a system (which is not changeable) which runs the same Python script 10-100 times simultanousley. Not all the time, but when it does it, than all at once.
Actually this script, which is executes x times at the exact same moment (or just with a delay of milliseconds) needs to ask a Web API for certain data. This Web API cant handle that much requests at once (which I cant change either, nor can I modify this API in any way).
So what I would like to build, is some kind of seperate python script which runs all the time and is waiting for input from all those other scripts. This seperate script should recieve the request payload for the API, than creates a que and gets all that data. After this, is gives back the data to the python script asked for the data.
Is this somehow possible? Can someone even understand my problem? Sorry for my complicated description :D
Actually I solved this problem with an RNG in that one Script that is executed multiple times, before those scripts perform the API request, they pause for rng(x) milliseconds, so they arent execute the request all at once - but this solution is not really failproof.
Maybe there is a better solution for my problem, than my first idea.
Thanks for your help!