public final class CaffeineUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <K,V,E extends Exception> |
invalidateEagerly(com.github.benmanes.caffeine.cache.AsyncLoadingCache<K,V> cache,
Promise<V,E> promise,
K key)
Preemptively invalidates the cache entry on failure.
|
public static <K,V,E extends Exception> Promise<V,E> invalidateEagerly(com.github.benmanes.caffeine.cache.AsyncLoadingCache<K,V> cache, Promise<V,E> promise, K key)
Let Caffeine handle the removal if the entry is already completed. This avoids a recursive modification issue from the underlying map implementation.
K
- type of the keyV
- type of the cached valueE
- promise's exception typecache
- the async cachepromise
- promise of the cache entrykey
- the looked up keyCopyright 2011-2017 ForgeRock AS.