2252 | clojure.core.cache/->BasicCache |
2253 | clojure.core.cache/->FIFOCache |
2254 | clojure.core.cache/->FnCache |
2255 | clojure.core.cache/->LIRSCache |
2256 | clojure.core.cache/->LRUCache |
2257 | clojure.core.cache/->LUCache |
2258 | clojure.core.cache/->SoftCache |
2259 | clojure.core.cache/->TTLCacheQ |
2260 | clojure.core.cache/basic-cache-factory |
2261 | clojure.core.cache/defcache |
26 | (:require [eastwood.copieddeps.dep4.clojure.core.cache :as cache])) |
80 | (has? [_ item] |
81 | (eastwood.copieddeps.dep4.clojure.core.cache/has? cache item)) |
82 | (hit [_ item] |
83 | (PluggableMemoization. f (eastwood.copieddeps.dep4.clojure.core.cache/hit cache item))) |
84 | (miss [_ item result] |
85 | (PluggableMemoization. f (eastwood.copieddeps.dep4.clojure.core.cache/miss cache item result))) |
86 | (evict [_ key] |
87 | (PluggableMemoization. f (eastwood.copieddeps.dep4.clojure.core.cache/evict cache key))) |
10 | :author "Fogus"} |
11 | eastwood.copieddeps.dep4.clojure.core.cache |
12 | (:require eastwood.copieddeps.dep5.clojure.data.priority-map) |
52 | ([wrap-fn value-fn cache item] |
53 | (if (eastwood.copieddeps.dep4.clojure.core.cache/has? cache item) |
54 | (eastwood.copieddeps.dep4.clojure.core.cache/hit cache item) |
55 | (eastwood.copieddeps.dep4.clojure.core.cache/miss cache item (wrap-fn #(value-fn %) item))))) |
63 | (if (eastwood.copieddeps.dep4.clojure.core.cache/has? cache item) |
26 | (:require [clojure.core.cache :as cache])) |
80 | (has? [_ item] |
81 | (clojure.core.cache/has? cache item)) |
82 | (hit [_ item] |
83 | (PluggableMemoization. f (clojure.core.cache/hit cache item))) |
84 | (miss [_ item result] |
85 | (PluggableMemoization. f (clojure.core.cache/miss cache item result))) |
86 | (evict [_ key] |
87 | (PluggableMemoization. f (clojure.core.cache/evict cache key))) |
10 | :author "Fogus"} |
11 | clojure.core.cache |
12 | (:require clojure.data.priority-map) |
52 | ([wrap-fn value-fn cache item] |
53 | (if (clojure.core.cache/has? cache item) |
54 | (clojure.core.cache/hit cache item) |
55 | (clojure.core.cache/miss cache item (wrap-fn #(value-fn %) item))))) |
63 | (if (clojure.core.cache/has? cache item) |
4 | (:require |
5 | [clojure.core.cache :as cache] |
6 | [clojure.core.cache.wrapped :as cache.wrapped] |
7 | [clojure.string :as str] |
521 | (def ^:dynamic *metadata-provider-cache* |
522 | "Bind this to a `(atom (clojure.core.cache/basic-cache-factory {}))` or similar cache-atom, and |
8 | (defprotocol Cache |
9 | "Cache protocol that copycats clojure.core.cache/CacheProtocol to make it easy to use |
10 | core.cache while not requiring unnecessary dependency if context is unused" |
36 | (try |
37 | (let [core-cache-protocol @(requiring-resolve 'clojure.core.cache/CacheProtocol) |
38 | core-cache-lookup @(requiring-resolve 'clojure.core.cache/lookup) |
39 | core-cache-has? @(requiring-resolve 'clojure.core.cache/has?) |
40 | core-cache-hit @(requiring-resolve 'clojure.core.cache/hit) |
41 | core-cache-miss @(requiring-resolve 'clojure.core.cache/miss) |
1 | {"namespaces" |
2 | {"clojure.core.cache" |
3 | [{"ns" "clojure.core.cache", |
4 | "name" "lru-cache-factory", |
11 | "(defn lru-cache-factory\n \"Returns an LRU cache with the cache and usage-table initialied to `base` --\n each entry is initialized with the same usage value.\n\n This function takes an optional `:threshold` argument that defines the maximum number\n of elements in the cache before the LRU semantics apply (default is 32).\"\n [base & {threshold :threshold :or {threshold 32}}]\n {:pre [(number? threshold) (< 0 threshold)\n (map? base)]}\n (clojure.core.cache/seed (LRUCache. {} {} 0 threshold) base))", |
2 | (:require |
3 | #?(:clj [clojure.core.cache :as cache] |
4 | :cljs [cljs.cache :as cache]) |
25 | (defn bounded-cache-factory |
26 | "Create a bounded [[clojure.core.cache]]-compatible cache. This is a basic map with no bookkeeping on `hit` but |
27 | that will completely discard the cache if it exceeds the `threshold` size. |
45 | ;; core.cache |
46 | (c/copy-namespaces-unmodified ccache-src-path staging-path 'clojure.core.cache for-real) |
47 | (c/move-namespaces-and-rename staging-path src-path 'clojure.core.cache 'eastwood.copieddeps.dep4.clojure.core.cache [src-path] for-real) |