class AsyncLoadingCache[K, V] extends AsyncCache[K, V]
- Alphabetic
- By Inheritance
- AsyncLoadingCache
- AsyncCache
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new AsyncLoadingCache(underlying: benmanes.caffeine.cache.AsyncLoadingCache[K, V])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(key: K): Future[V]
Returns the future associated with
keyin this cache, obtaining that value fromloaderif necessary.Returns the future associated with
keyin this cache, obtaining that value fromloaderif necessary. If the asynchronous computation fails, the entry will be automatically removed.- key
key with which the specified value is to be associated
- returns
the current (existing or computed) future value associated with the specified key
- Exceptions thrown
java.lang.RuntimeExceptionor Error if theloaderdoes when constructing the future, in which case the mapping is left unestablished
-
def
get(key: K, mappingFunction: (K) ⇒ V): Future[V]
Returns the future associated with
keyin this cache, obtaining that value frommappingFunctionif necessary.Returns the future associated with
keyin this cache, obtaining that value frommappingFunctionif necessary. This method provides a simple substitute for the conventional "if cached, return; otherwise create, cache and return" pattern.- 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
- Definition Classes
- AsyncCache
-
def
getAll(keys: Iterable[K]): Future[Map[K, V]]
Returns the future of a map of the values associated with
keys, creating or retrieving those values if necessary.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.- 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
- Exceptions thrown
java.lang.RuntimeExceptionor Error if theloaderdoes so
-
def
getAll(keys: Iterable[K], mappingFunction: (Iterable[K]) ⇒ Map[K, V]): Future[Map[K, V]]
Returns the future of a map of the values associated with
keys, creating or retrieving those values if necessary.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
mappingFunctionis performed for all keys which are not already present in the cache.- 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
- Definition Classes
- AsyncCache
- Exceptions thrown
java.lang.RuntimeExceptionor Error if the mappingFunction does when constructing the future, in which case the mapping is left unestablished
-
def
getAllFuture(keys: Iterable[K], mappingFunction: (Iterable[K]) ⇒ Future[Map[K, V]]): Future[Map[K, V]]
Returns the future of a map of the values associated with
keys, creating or retrieving those values if necessary.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
mappingFunctionis performed for all keys which are not already present in the cache.- 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
- Definition Classes
- AsyncCache
- Exceptions thrown
java.lang.RuntimeExceptionor Error if the mappingFunction does when constructing the future, in which case the mapping is left unestablished
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getFuture(key: K, mappingFunction: (K) ⇒ Future[V]): Future[V]
Returns the future associated with
keyin this cache, obtaining that value frommappingFunctionif necessary.Returns the future associated with
keyin this cache, obtaining that value frommappingFunctionif necessary. This method provides a simple substitute for the conventional "if cached, return; otherwise create, cache and return" pattern.- 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
- Definition Classes
- AsyncCache
- Exceptions thrown
java.lang.RuntimeExceptionor Error if the mappingFunction does when constructing the future, in which case the mapping is left unestablished
-
def
getIfPresent(key: K): Option[Future[V]]
Returns the future associated with
keyin this cache, orNoneif there is no cached future forkey.Returns the future associated with
keyin this cache, orNoneif there is no cached future forkey.- 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
Noneif this map contains no mapping for the key
- Definition Classes
- AsyncCache
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
put(key: K, valueFuture: Future[V]): Unit
Associates
valuewithkeyin this cache.Associates
valuewithkeyin this cache. If the cache previously contained a value associated withkey, the old value is replaced byvalue. If the asynchronous computation fails, the entry will be automatically removed.- key
key with which the specified value is to be associated
- valueFuture
value to be associated with the specified key
- Definition Classes
- AsyncCache
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
synchronous(): LoadingCache[K, V]
Returns a view of the entries stored in this cache as a synchronous LoadingCache.
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
- AsyncLoadingCache → AsyncCache
-
def
toString(): String
- Definition Classes
- AsyncLoadingCache → AnyRef → Any
-
val
underlying: benmanes.caffeine.cache.AsyncLoadingCache[K, V]
- Definition Classes
- AsyncLoadingCache → AsyncCache
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )