Liking cljdoc? Tell your friends :D

cloffeine.cache


as-mapclj

(as-map cache)

Returns a view of the entries stored in this cache as a thread-safe map.

Returns a view of the entries stored in this cache as a thread-safe map.
sourceraw docstring

cleanupclj

(cleanup cache)

Performs any pending maintenance operations needed by the cache.

Performs any pending maintenance operations needed by the cache.
sourceraw docstring

computeclj

(compute cache k remapper-fn)

see: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentMap.html#compute-K-java.util.function.BiFunction- Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping). For example, to either create or append a String msg to a value mapping: (compute cache "k" (fn [k, v] (if (nil? v) msg (str v msg)))

see: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentMap.html#compute-K-java.util.function.BiFunction-
Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping). For example, to either create or append a String msg to a value mapping:
`(compute cache "k" (fn [k, v] (if (nil? v) msg (str v msg)))`
sourceraw docstring

estimated-sizeclj

(estimated-size cache)

Returns the approximate number of entries in this cache.

Returns the approximate number of entries in this cache.
sourceraw docstring

getclj

(get cache k loading-fn)

Returns the value associated with the key in this cache, obtaining that value from the mappingFunction if necessary.

Returns the value associated with the key in this cache, obtaining that value from the mappingFunction if necessary.
sourceraw docstring

get-allclj

(get-all cache ks mapping-fn)

Returns a map of the values associated with the keys, creating or retrieving those values if necessary.

Returns a map of the values associated with the keys, creating or retrieving those values if necessary.
sourceraw docstring

get-all-presentclj

(get-all-present cache ks)

Returns a map of the values associated with the keys in this cache.

Returns a map of the values associated with the keys in this cache.
sourceraw docstring

get-if-presentclj

(get-if-present cache k)

Returns the value associated with the key in this cache, or null if there is no cached value for the key.

Returns the value associated with the key in this cache, or null if there is no cached value for the key.
sourceraw docstring

invalidate!clj

(invalidate! cache k)

Discards any cached value for the key.

Discards any cached value for the key.
sourceraw docstring

invalidate-all!clj

(invalidate-all! cache)
(invalidate-all! cache ks)

Discards all entries in the cache.

Discards all entries in the cache.
sourceraw docstring

make-cacheclj

(make-cache)
(make-cache settings)

Create an AsyncLoadingCache. See cloffeine.common/builder for settings. A semi-persistent mapping from keys to values. Cache entries are manually added using get(Object, Function) or put(Object, Object), and are stored in the cache until either evicted or manually invalidated. Implementations of this interface are expected to be thread-safe, and can be safely accessed by multiple concurrent threads.

Create an AsyncLoadingCache. See `cloffeine.common/builder` for settings.
  A semi-persistent mapping from keys to values. Cache entries are manually added using get(Object, Function) or put(Object, Object), and are stored in the cache until either evicted or manually invalidated.
Implementations of this interface are expected to be thread-safe, and can be safely accessed by multiple concurrent threads.
sourceraw docstring

policyclj

(policy cache)

Returns access to inspect and perform low-level operations on this cache based on its runtime characteristics.

Returns access to inspect and perform low-level operations on this cache based on its runtime characteristics.
sourceraw docstring

put!clj

(put! cache k v)

Associates the value with the key in this cache.

Associates the value with the key in this cache.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close