Liking cljdoc? Tell your friends :D

defcash.core


build-cache-factoryclj

(build-cache-factory metadata)
source

cache-fnclj

(cache-fn metadata fun)
source

CACHE_FACTORIESclj

source

defn$cljmacro

(defn$ & defnargs)

Like clojure.core/defn but supports controlling cache behaviors via metadata.

^{:ttl/threshold 5000} will cache values for 5 seconds. ^{:fifo/threshold 500} will do a sliding window of the 500 most recent invocations. ^{:lu/threshold 500} will keep 500 items and then remove items that are accessed the least. ^{:lru/threshold 500} will keep 500 items and then remove the items that were least recently used.

If you specify none of the controlling attributes mentioned above, unbounded memoization will be used.

You can also provide a cache seed using metadata. The seed should be a map of argument vectors to return values.

^{:seed {[1] :value1 [2] :value2}}

Note that you can specify more than one of the above in the metadata map and the requested behaviors will compose. Composition is applied in the order you defined the keys in the map.

Like clojure.core/defn but supports controlling cache behaviors via metadata.

^{:ttl/threshold 5000} will cache values for 5 seconds.
^{:fifo/threshold 500} will do a sliding window of the 500 most recent invocations.
^{:lu/threshold 500} will keep 500 items and then remove items that are accessed the least.
^{:lru/threshold 500} will keep 500 items and then remove the items that were least recently used.

If you specify none of the controlling attributes mentioned above, unbounded memoization will be used.

You can also provide a cache seed using metadata. The seed should be a map of argument vectors to return values.

^{:seed {[1] :value1 [2] :value2}}

Note that you can specify more than one of the above in the metadata map and the requested behaviors will
compose. Composition is applied in the order you defined the keys in the map.
sourceraw docstring

memo-clear!clj

(memo-clear! f)
(memo-clear! f args)

Like clojure.core.memoize/memo-clear! except preserves seed values.

Like clojure.core.memoize/memo-clear! except preserves seed values.
sourceraw docstring

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

× close