(evict! stockroom k)
Evicts the given key from the cache. Returns nil.
Evicts the given key from the cache. Returns nil.
(flush! stockroom)
Flushes / empties the cache. Returns nil.
Flushes / empties the cache. Returns nil.
(get stockroom k)
Gets the value for the given key from the cache. Returns nil if the key is not present.
Gets the value for the given key from the cache. Returns nil if the key is not present.
(keys stockroom)
Returns all keys in the cache as a sequence.
Returns all keys in the cache as a sequence.
(memoize-sr f)
(memoize-sr f num-keys)
Memoizes the given function, based on the arguments passed to the function.
Optionally takes a num-keys
argument which specifies the cache capacity.
If num-keys
is not provided, a cache of size 100 is used.
Returns the memoized function.
Memoizes the given function, based on the arguments passed to the function. Optionally takes a `num-keys` argument which specifies the cache capacity. If `num-keys` is not provided, a cache of size 100 is used. Returns the memoized function.
(put! stockroom k v)
Adds the given key and value to the cache. Returns nil.
Adds the given key and value to the cache. Returns nil.
(stockroom num-keys)
Returns a new stockroom cache with the given capacity.
Returns a new stockroom cache with the given capacity.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close