Liking cljdoc? Tell your friends :D

cljs.cache

cljs

A port of clojure/core.cache to Clojurescript

A port of clojure/core.cache to Clojurescript
raw docstring

basic-cache-factorycljs

(basic-cache-factory base)

Returns a pluggable basic cache initialied to base

Returns a pluggable basic cache initialied to `base`
sourceraw docstring

BasicCachecljs

source

CacheProtocolcljsprotocol

This is the protocol describing the basic cache capability.

This is the protocol describing the basic cache capability.

evictcljs

(evict cache e)

Removes an entry from the cache

Removes an entry from the cache

has?cljs

(has? cache e)

Checks if the cache contains a value associated with e

Checks if the cache contains a value associated with `e`

hitcljs

(hit cache e)

Is meant to be called if the cache is determined to contain a value associated with e

Is meant to be called if the cache is determined to contain a value
associated with `e`

lookupcljs

(lookup cache e)
(lookup cache e not-found)

Retrieve the value associated with e if it exists, else nil in the 2-arg case. Retrieve the value associated with e if it exists, else not-found in the 3-arg case.

Retrieve the value associated with `e` if it exists, else `nil` in
the 2-arg case. Retrieve the value associated with `e` if it exists,
else `not-found` in the 3-arg case.

misscljs

(miss cache e ret)

Is meant to be called if the cache is determined to not contain a value associated with e

Is meant to be called if the cache is determined to **not** contain a
value associated with `e`

seedcljs

(seed cache base)

Is used to signal that the cache should be created with a seed. The contract is that said cache should return an instance of its own type.

Is used to signal that the cache should be created with a seed.
The contract is that said cache should return an instance of its
own type.
sourceraw docstring

defcacheclj/smacro

(defcache type-name fields & specifics)
source

lru-cache-factorycljs

(lru-cache-factory base & {threshold :threshold :or {threshold 32}})

Returns an LRU cache with the cache and usage-table initialied to base -- each entry is initialized with the same usage value. This function takes an optional :threshold argument that defines the maximum number of elements in the cache before the LRU semantics apply (default is 32).

Returns an LRU cache with the cache and usage-table initialied to `base` --
each entry is initialized with the same usage value.
This function takes an optional `:threshold` argument that defines the maximum number
of elements in the cache before the LRU semantics apply (default is 32).
sourceraw docstring

LRUCachecljs

source

throughcljs

(through cache item)
(through value-fn cache item)
(through wrap-fn value-fn cache item)

The basic hit/miss logic for the cache system. Expects a wrap function and value function. The wrap function takes the value function and the item in question and is expected to run the value function with the item whenever a cache miss occurs. The intent is to hide any cache-specific cells from leaking into the cache logic itelf.

The basic hit/miss logic for the cache system. Expects a wrap function and
value function.  The wrap function takes the value function and the item in
question and is expected to run the value function with the item whenever a
cache miss occurs.  The intent is to hide any cache-specific cells from
leaking into the cache logic itelf.
sourceraw docstring

ttl-cache-factorycljs

(ttl-cache-factory base & {ttl :ttl :or {ttl 2000}})

Returns a TTL cache with the cache and expiration-table initialied to base -- each with the same time-to-live.

This function also allows an optional :ttl argument that defines the default time in milliseconds that entries are allowed to reside in the cache.

Returns a TTL cache with the cache and expiration-table initialied to `base` --
each with the same time-to-live.

This function also allows an optional `:ttl` argument that defines the default
time in milliseconds that entries are allowed to reside in the cache.
sourceraw docstring

TTLCachecljs

source

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

× close