I am using bucket4j to do some rate limiting in my project. I have 1M users Basically I have for each user 1 bucket I keep the buckets in a ConcurrentHashMap<String, Bucket> structure Not all users are connected at the same time and I need to remove entries in the map which have not been recently used I need to check periodically on the hashMap and delete those entries which bucket has not been consumed let's say in last 5 minutes
How can I do it ? I know I can have my own data structure but I was really expecting that Bucket could provide something last time a token was consumed
Is it possible ?