How can you implement a rate limiter in Java? Need to call a rateLimiter function that return true if you can perform a request and false if you cannot. The rate limiter is limited by number of calls during X seconds, each caller has a unique id.
Sigiloso
A map with key = unique Id, value = counter of calls and a thread running in the background that cleans the map each X seconds.