Partial implementation client resilience

This commit is contained in:
rubenpirreram
2026-05-07 21:17:00 +02:00
parent 7757b38155
commit e78096d2e0
10 changed files with 101 additions and 34 deletions
@@ -48,8 +48,14 @@ public class LimitedMap<K, V> implements Map<K, V> {
*/
@Override
public synchronized V put(K key, V value) {
boolean added = true;
if(map.size()==limit) {
if(!map.containsKey(key))
return null;
added = false;
}
V result = map.put(key, value);
if (map.size() >= limit) {
if (map.size() >= limit && added) {
action.run();
}
return result;