Class Async.AsyncWeigher<K,V>
java.lang.Object
com.github.benmanes.caffeine.cache.Async.AsyncWeigher<K,V>
- All Implemented Interfaces:
Weigher<K,
,CompletableFuture<V>> Serializable
- Enclosing class:
- Async
static final class Async.AsyncWeigher<K,V>
extends Object
implements Weigher<K,CompletableFuture<V>>, Serializable
A weigher for asynchronous computations. When the value is being loaded this weigher returns
0
to indicate that the entry should not be evicted due to a size constraint. If the
value is computed successfully the entry must be reinserted so that the weight is updated and
the expiration timeouts reflect the value once present. This can be done safely using
Map.replace(Object, Object, Object)
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
weigh
(K key, CompletableFuture<V> future) Returns the weight of a cache entry.(package private) Object
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
delegate
-
-
Constructor Details
-
AsyncWeigher
-
-
Method Details