Caffeine cache implementation.
Caffeine cache implementation.
(assoc-imm-val! transient-m k v xf)
If cached value is a completable future with immediately available value, assoc it to transient.
If cached value is a completable future with immediately available value, assoc it to transient.
(conf->builder {:memento.core/keys [initial-capacity size< ttl fade]
:memento.caffeine/keys [weight< removal-listener kv-weight
weak-keys weak-values soft-values
refresh stats ticker]}
sec-index)
Creates and configures common parameters on the builder.
Creates and configures common parameters on the builder.
(conf->sec-index {:memento.core/keys [concurrency initial-capacity]})
Creates secondary index for evictions
Creates secondary index for evictions
(sec-index-conj-entry sec-index k v)
Add entry to secondary index. k is CacheKey of incoming Cache entry v is value of incoming cache entry, might be EntryMeta, if it is then we use each tag-idents as key (id) pointing to a HashSet of CacheKeys.
For each ID we add CacheKey to its HashSet.
Add entry to secondary index. k is CacheKey of incoming Cache entry v is value of incoming cache entry, might be EntryMeta, if it is then we use each tag-idents as key (id) pointing to a HashSet of CacheKeys. For each ID we add CacheKey to its HashSet.
(sec-index-disj-entry sec-index k v)
Remove value from secondary index, processing EntityMeta if there is one.
k is CacheKey of Cache entry being removed v is value of Cache entry, might be EntryMeta, if it is then we use each of tag-idents as key (id) pointing to a HashSet. We remove CacheKey from each set, removing the whole entry if the resulting set is empty.
Remove value from secondary index, processing EntityMeta if there is one. k is CacheKey of Cache entry being removed v is value of Cache entry, might be EntryMeta, if it is then we use each of tag-idents as key (id) pointing to a HashSet. We remove CacheKey from each set, removing the whole entry if the resulting set is empty.
(stats fn-or-cache)
Return caffeine stats for the cache if it is a caffeine Cache.
Takes a memoized fn or a Cache instance as a parameter.
Returns com.github.benmanes.caffeine.cache.stats.CacheStats
Return caffeine stats for the cache if it is a caffeine Cache. Takes a memoized fn or a Cache instance as a parameter. Returns com.github.benmanes.caffeine.cache.stats.CacheStats
(val->cval v)
Converts val into cache friendly version. The problem is that AsyncCache has 'smart' feature where it will delete entries where CompletableFuture has nil value or exception value.
Converts val into cache friendly version. The problem is that AsyncCache has 'smart' feature where it will delete entries where CompletableFuture has nil value or exception value.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close