Cache
Value members
Concrete methods
Immediately run any pending maintenance operations on this cache, such as evicting expired entries.
Immediately run any pending maintenance operations on this cache, such as evicting expired entries.
Returns the estimated size for this cache. It is only an estimation as it depends if there are pending computations/evictions pending.
Returns the estimated size for this cache. It is only an estimation as it depends if there are pending computations/evictions pending.
- Returns:
the estimated size of this cache
Returns the value associated to the given key in this cache, or asynchronously compute it if missing.
Returns the value associated to the given key in this cache, or asynchronously compute it if missing.
- Value parameters:
- key
the key whose associated value is to be returned
- mappingFunction
the function defining how to compute a new value for a given key
- Returns:
the current or newly computed value for the given key
Returns the values associated with the given keys in this cache, or asynchronously compute them if missing. Keys
that are missing from the mappingFunction
result won’t be saved in the cache.
Returns the values associated with the given keys in this cache, or asynchronously compute them if missing. Keys
that are missing from the mappingFunction
result won’t be saved in the cache.
- Value parameters:
- keys
the keys for which the associated values are to be returned
- mappingFunction
the function defining how to compute values for keys that are missing from the cache
- Returns:
the current or newly computed values for the given keys
Returns the values associated with the given keys in this cache, or asynchronously compute them if missing. Keys
that are missing from the mappingFunction
result won’t be saved in the cache.
Returns the values associated with the given keys in this cache, or asynchronously compute them if missing. Keys
that are missing from the mappingFunction
result won’t be saved in the cache.
- Value parameters:
- keys
the keys for which the associated values are to be returned
- mappingFunction
the function defining how to compute values for keys that are missing from the cache
- Returns:
the current or newly computed values for the given keys
Returns the value associated with the given key if present in this cache, otherwise returns None.
Returns the value associated with the given key if present in this cache, otherwise returns None.
- Value parameters:
- key
the key whose associated value is to be returned
- Returns:
the current value if present, otherwise None
Removes the cached value for the given key in this cache if present.
Removes the cached value for the given key in this cache if present.
- Value parameters:
- key
the key whose cached value is to be removed from the cache
Remove the cached values for the given keys in this cache if present.
Remove the cached values for the given keys in this cache if present.
- Value parameters:
- keys
the keys whose cached values are to be removed from the cache
Remove the cached values for the given keys in this cache if present.
Remove the cached values for the given keys in this cache if present.
- Value parameters:
- keys
the keys whose cached values are to be removed from the cache
Creates or replaces the cached value for the given key in this cache. If the computation failed, remove the existing entry.
Creates or replaces the cached value for the given key in this cache. If the computation failed, remove the existing entry.
- Value parameters:
- key
the key to associate with the value
- value
the value to associate with the key
Returns the cache statistics computed for this cache, if previously enabled with recordStats
when building the
cache. To be used with caution as it induces a performance penalty.
Returns the cache statistics computed for this cache, if previously enabled with recordStats
when building the
cache. To be used with caution as it induces a performance penalty.
- Returns:
the cache statistics for this cache