I have a method that use an API of another system. My system to run on a list of data and for each item in the list it create a thread with request to the other system. There is only one problem, the other system can handle x amount of request every y time. For example, Handling 5 requests every 2 minutes. What is the best practice to implement it? lets say that i want to run over the list only one time.
To make it more clear, lets say i approach some service via the internet and this service allow me to send 5 requests every 2 minutes, i have an xml with 1000 rows and each row is a request i want to read this xml and send requests but i don't want the other system to deny me i want to send 5 request every 2 minutes. Thanks.