(ttl-cache-factory base & {ttl :ttl, :or {ttl 2000}})
Returns a TTL cache with the cache and expiration-table initialized 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.
Source
(defn ttl-cache-factory
"Returns a TTL cache with the cache and expiration-table initialized 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."
[base & {ttl :ttl :or {ttl 2000}}]
{:pre [(number? ttl) (<= 0 ttl)
(map? base)]}
(clojure.core.cache/seed (TTLCache. {} {} ttl) base))