(evict! stockroom k)
Inputs: [stockroom :- Stockroom k :- Key] Returns: (s/eq nil)
Evicts the given key from the cache. Returns nil.
Inputs: [stockroom :- Stockroom k :- Key] Returns: (s/eq nil) Evicts the given key from the cache. Returns nil.
(flush! stockroom)
Inputs: [stockroom :- Stockroom] Returns: (s/eq nil)
Flushes / empties the cache. Returns nil.
Inputs: [stockroom :- Stockroom] Returns: (s/eq nil) Flushes / empties the cache. Returns nil.
(get stockroom k)
Inputs: [stockroom :- Stockroom k :- Key] Returns: (s/maybe Value)
Gets the value for the given key from the cache. Returns nil if the key is not present.
Inputs: [stockroom :- Stockroom k :- Key] Returns: (s/maybe Value) Gets the value for the given key from the cache. Returns nil if the key is not present.
(keys stockroom)
Inputs: [stockroom :- Stockroom] Returns: [Key]
Returns all keys in the cache as a sequence.
Inputs: [stockroom :- Stockroom] Returns: [Key] Returns all keys in the cache as a sequence.
(memoize-sr f)
(memoize-sr f num-keys)
(memoize-sr G__5721)
(memoize-sr G__5725 G__5726)
Inputs: ([f :- Function] [f :- Function num-keys :- s/Int]) Returns: 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.
Inputs: ([f :- Function] [f :- Function num-keys :- s/Int]) Returns: 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)
Inputs: [stockroom :- Stockroom k :- Key v :- Value] Returns: (s/eq nil)
Adds the given key and value to the cache. Returns nil.
Inputs: [stockroom :- Stockroom k :- Key v :- Value] Returns: (s/eq nil) Adds the given key and value to the cache. Returns nil.
(stockroom num-keys)
Inputs: [num-keys :- s/Int] Returns: Stockroom
Returns a new stockroom cache with the given capacity.
Inputs: [num-keys :- s/Int] Returns: Stockroom Returns a new stockroom cache with the given capacity.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close