I have to load images from a host that rate limits requests to ~2 per second. When scrolling in a list with many images, all loaded from the same host, that causes problems of course. How do I best implement a rate limiter in my app that keeps track of the requests and limits and makes sure the requests only go out when it is ok for the API again?
I would probably show a spinner/loader in place of the images while the API doesn’t let me load them.
Are there any libraries that solve this problem? Any code or examples I can refer to?