All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cloud.eppo.cache.LRUInMemoryAssignmentCache Maven / Gradle / Ivy

There is a newer version: 3.3.2
Show newest version
package cloud.eppo.cache;

import cloud.eppo.api.AbstractAssignmentCache;
import java.util.Collections;
import org.apache.commons.collections4.map.LRUMap;

/**
 * A cache that uses the LRU algorithm to evict the least recently used items.
 *
 * 

The primary use case is for server-side SDKs, where the cache is shared across multiple users. */ public class LRUInMemoryAssignmentCache extends AbstractAssignmentCache { public LRUInMemoryAssignmentCache(int maxSize) { // Synchronized wrapper for thread safety super(Collections.synchronizedMap(new LRUMap<>(maxSize))); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy