- Companion:
- object
Value members
Concrete methods
Returns the future associated with key
in this cache, obtaining that
value from loader
if necessary. If the asynchronous computation fails,
the entry will be automatically removed.
Returns the future associated with key
in this cache, obtaining that
value from loader
if necessary. If the asynchronous computation fails,
the entry will be automatically removed.
- Value parameters:
- key
key with which the specified value is to be associated
- Returns:
the current (existing or computed) future value associated with the specified key
- Throws:
- java.lang.RuntimeException
or Error if the
loader
does when constructing the future, in which case the mapping is left unestablished
Returns the future of a map of the values associated with keys
, creating
or retrieving those values if necessary. The returned map contains entries
that were already cached, combined with newly loaded entries. If the any
of the asynchronous computations fail, those entries will be automatically
removed.
Returns the future of a map of the values associated with keys
, creating
or retrieving those values if necessary. The returned map contains entries
that were already cached, combined with newly loaded entries. If the any
of the asynchronous computations fail, those entries will be automatically
removed.
- Value parameters:
- keys
the keys whose associated values are to be returned
- Returns:
the future containing an mapping of keys to values for the specified keys in this cache
- Throws:
- java.lang.RuntimeException
or Error if the
loader
does so
Returns a view of the entries stored in this cache as a synchronous LoadingCache. A mapping is not present if the value is currently being loaded. Modifications made to the synchronous cache directly affect the asynchronous cache. If a modification is made to a mapping that is currently loading, the operation blocks until the computation completes.
Returns a view of the entries stored in this cache as a synchronous LoadingCache. A mapping is not present if the value is currently being loaded. Modifications made to the synchronous cache directly affect the asynchronous cache. If a modification is made to a mapping that is currently loading, the operation blocks until the computation completes.
- Returns:
a thread-safe synchronous view of this cache
- Definition Classes
Inherited methods
Returns the future associated with key
in this cache, obtaining that
value from mappingFunction
if necessary. This method provides a simple
substitute for the conventional "if cached, return; otherwise create,
cache and return" pattern.
Returns the future associated with key
in this cache, obtaining that
value from mappingFunction
if necessary. This method provides a simple
substitute for the conventional "if cached, return; otherwise create,
cache and return" pattern.
- Value parameters:
- key
key with which the specified value is to be associated
- mappingFunction
the function to asynchronously compute a value
- Returns:
the current (existing or computed) future value associated with the specified key
- Inherited from:
- AsyncCache
Returns the future of a map of the values associated with keys
, creating
or retrieving those values if necessary. The returned map contains entries
that were already cached, combined with newly loaded entries. If the any
of the asynchronous computations fail, those entries will be automatically
removed from this cache.
Returns the future of a map of the values associated with keys
, creating
or retrieving those values if necessary. The returned map contains entries
that were already cached, combined with newly loaded entries. If the any
of the asynchronous computations fail, those entries will be automatically
removed from this cache.
A single request to the mappingFunction
is performed for all keys which
are not already present in the cache.
- Value parameters:
- keys
the keys whose associated values are to be returned
- mappingFunction
the function to asynchronously compute the values
- Returns:
the future containing an unmodifiable mapping of keys to values for the specified keys in this cache
- Throws:
- java.lang.RuntimeException
or Error if the mappingFunction does when constructing the future, in which case the mapping is left unestablished
- Inherited from:
- AsyncCache
Returns the future of a map of the values associated with keys
, creating
or retrieving those values if necessary. The returned map contains entries
that were already cached, combined with newly loaded entries. If the any
of the asynchronous computations fail, those entries will be automatically
removed from this cache.
Returns the future of a map of the values associated with keys
, creating
or retrieving those values if necessary. The returned map contains entries
that were already cached, combined with newly loaded entries. If the any
of the asynchronous computations fail, those entries will be automatically
removed from this cache.
A single request to the mappingFunction
is performed for all keys which
are not already present in the cache.
- Value parameters:
- keys
the keys whose associated values are to be returned
- mappingFunction
the function to asynchronously compute the values
- Returns:
the future containing an unmodifiable mapping of keys to values for the specified keys in this cache
- Throws:
- java.lang.RuntimeException
or Error if the mappingFunction does when constructing the future, in which case the mapping is left unestablished
- Inherited from:
- AsyncCache
Returns the future associated with key
in this cache, obtaining that
value from mappingFunction
if necessary. This method provides a simple
substitute for the conventional "if cached, return; otherwise create,
cache and return" pattern.
Returns the future associated with key
in this cache, obtaining that
value from mappingFunction
if necessary. This method provides a simple
substitute for the conventional "if cached, return; otherwise create,
cache and return" pattern.
- Value parameters:
- key
key with which the specified value is to be associated
- mappingFunction
the function to asynchronously compute a value
- Returns:
the current (existing or computed) future value associated with the specified key
- Throws:
- java.lang.RuntimeException
or Error if the mappingFunction does when constructing the future, in which case the mapping is left unestablished
- Inherited from:
- AsyncCache
Returns the future associated with key
in this cache, or None
if there
is no cached future for key
.
Returns the future associated with key
in this cache, or None
if there
is no cached future for key
.
- Value parameters:
- key
key whose associated value is to be returned
- Returns:
an option containing the current (existing or computed) future value to which the specified key is mapped, or
None
if this map contains no mapping for the key- Inherited from:
- AsyncCache
Associates value
with key
in this cache. If the cache previously
contained a value associated with key
, the old value is replaced by
value
. If the asynchronous computation fails, the entry will be
automatically removed.
Associates value
with key
in this cache. If the cache previously
contained a value associated with key
, the old value is replaced by
value
. If the asynchronous computation fails, the entry will be
automatically removed.
- Value parameters:
- key
key with which the specified value is to be associated
- valueFuture
value to be associated with the specified key
- Inherited from:
- AsyncCache