Caching tools for use with Pharmacist prescriptions
Caching tools for use with Pharmacist prescriptions
(atom-map ref)
Given a ref to use as a cache, returns a map of parameters to pass as
the :cache parameter to pharmacist.prescription/fill
in order to look up
and store loaded data in the cache.
(require '[pharmacist.prescription :as p]
'[pharmacist.cache :as c]
'[clojure.core.cache :as cache])
(p/fill prescription {:cache (c/atom-map (atom (cache/ttl-cache-factory {})))})
Given a ref to use as a cache, returns a map of parameters to pass as the :cache parameter to [[pharmacist.prescription/fill]] in order to look up and store loaded data in the cache. ```clojure (require '[pharmacist.prescription :as p] '[pharmacist.cache :as c] '[clojure.core.cache :as cache]) (p/fill prescription {:cache (c/atom-map (atom (cache/ttl-cache-factory {})))}) ```
(cache-get cache path prescription)
Look up data source in the cache. Expects all parameters in prescription
to
be dependency resolved and fully realized.
Look up data source in the cache. Expects all parameters in `prescription` to be dependency resolved and fully realized.
(cache-put cache path prescription value)
Put item in cache. Expects all parameters in prescription
to be dependency
resolved and fully realized.
Put item in cache. Expects all parameters in `prescription` to be dependency resolved and fully realized.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close