Returns either the cached Future for the given key or evaluates the given value generating
function producing a Future[V]
.
Returns either the cached Future for the given key or evaluates the given value generating
function producing a Future[V]
.
Selects the (potentially non-existing) cache entry with the given key.
Selects the (potentially non-existing) cache entry with the given key.
Clears the cache by removing all entries.
Clears the cache by removing all entries.
Retrieves the future instance that is currently in the cache for the given key.
Retrieves the future instance that is currently in the cache for the given key. Returns None if the key has no corresponding cache entry.
Removes the cache item for the given key.
Removes the cache item for the given key. Returns the removed item if it was found (and removed).
Returns the upper bound for the number of currently cached entries.
Returns the upper bound for the number of currently cached entries. Note that this number might not reflect the exact number of active, unexpired cache entries, since expired entries are only evicted upon next access (or by being thrown out by a capacity constraint).
A thread-safe implementation of spray.caching.cache. The cache has a defined maximum number of entries it can store. After the maximum capacity is reached new entries cause old ones to be evicted in a last-recently-used manner, i.e. the entries that haven't been accessed for the longest time are evicted first.