org.greencheek.caching.herdcache.IsCachedValueUsable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of herdcache Show documentation
Show all versions of herdcache Show documentation
A cache that uses futures to prevent thundering herds to your backend service
package org.greencheek.caching.herdcache;
import java.io.Serializable;
import java.util.function.Predicate;
/**
* When a value is retrieved from the cache, this function can be called to determine
* if that cached value is valid to use or not. If not, the backend (the supplier) is called
* to generate a value
*/
public interface IsCachedValueUsable extends Predicate {
static final IsCachedValueUsable CACHED_VALUE_IS_ALWAYS_USABLE = (V) -> true;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy