(->Simple impl)
(->Simple impl miss)
Converts a CacheProtocol
into a SimpleCache
. The miss
function will be invoked with the entry to determine
and set the value if not found. Implements IFn as an alternative to invoking SimpleCache/get
WARNING: CLJS has a IFn argument limit of 20 args for both Apply and Invoke
Converts a `CacheProtocol` into a `SimpleCache`. The `miss` function will be invoked with the entry to determine and set the value if not found. Implements IFn as an alternative to invoking `SimpleCache/get` WARNING: CLJS has a IFn argument limit of 20 args for both Apply and Invoke
(->Simple-Fn-Cache {:keys [key-fn cache-fn miss-fn evict-fn reset-fn]
:or {key-fn identity}})
Constructs a function-backed SimpleCache
. The miss
function will be invoked with the entry to determine
and set the value if not found. Implements IFn as an alternative to invoking SimpleCache/get
Constructs a function-backed `SimpleCache`. The `miss` function will be invoked with the entry to determine and set the value if not found. Implements IFn as an alternative to invoking `SimpleCache/get`
(create-default)
(create-default seed)
Creates a TTL/LRU combination cache with default values and in initial seed (default {})
Creates a TTL/LRU combination cache with default values and in initial seed (default {})
(create-lru)
(create-lru seed)
(create-lru threshold seed)
Creates a Least Recently Used cache with an initial seed (default {}) and maximum value threshold (default 50).
Creates a Least Recently Used cache with an initial seed (default {}) and maximum value threshold (default 50).
(create-ttl)
(create-ttl seed)
(create-ttl ttl seed)
Creates a Time To Live cache with an initial seed (default {}) and maximum TTL in milliseconds (default 12 hours)
Creates a Time To Live cache with an initial seed (default {}) and maximum TTL in milliseconds (default 12 hours)
A simple, self contained cache protocol
A simple, self contained cache protocol
(evict this entry)
Evicts the entry
from the cache impl
Evicts the `entry` from the cache `impl`
(get this entry)
Retrieve the value associated with entry
if it exists within the cache impl
, else nil
.
May invoke a miss
function to create the entry
if not found.
Retrieve the value associated with `entry` if it exists within the cache `impl`, else `nil`. May invoke a `miss` function to create the `entry` if not found.
(reset this)
Resets the cache back to it's initial value
Resets the cache back to it's initial value
(set this entry value)
Sets the entry
to the specific value
within the cache impl
Sets the `entry` to the specific `value` within the cache `impl`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close