Memoization library with many features.
This namespace includes internal tooling and shouldn't be used directly unless writing extensions.
Memoization library with many features. This namespace includes internal tooling and shouldn't be used directly unless writing extensions.
(active-cache obj)
Return active cache from the object's meta.
Return active cache from the object's meta.
(attach f spec enabled? default-type)
Attach a cache to a fn or var. Internal function.
Scrape var or fn meta and add it to the spec.
Merge fn meta, var meta, spec.
Attach a cache to a fn or var. Internal function. Scrape var or fn meta and add it to the spec. Merge fn meta, var meta, spec.
Protocol for Cache. If Cache for a Region, it needs to check if Region is started to engage in caching.
Protocol for Cache. If Cache for a Region, it needs to check if Region is started to engage in caching.
(as-map this)
Returns the cache as a map. This does not imply a snapshot, as implementation might provide a weakly consistent view of the cache.
Returns the cache as a map. This does not imply a snapshot, as implementation might provide a weakly consistent view of the cache.
(get-cached this args)
Return cached value, possibly invoking the function with the args to obtain the value.
This should be a thread-safe atomic operation.
Return cached value, possibly invoking the function with the args to obtain the value. This should be a thread-safe atomic operation.
(invalidate this arg)
Invalidate entry for args, returns Cache
Invalidate entry for args, returns Cache
(invalidate-all this)
Invalidate all entries, returns Cache
Invalidate all entries, returns Cache
(put-all this args-to-vals)
Add entries to cache, returns Cache
Add entries to cache, returns Cache
Protocol for Caches for the regions. Main difference from Cache being that is houses entries for multiple functions. As such it takes additional parameter of function.
Protocol for Caches for the regions. Main difference from Cache being that is houses entries for multiple functions. As such it takes additional parameter of function.
(as-map* this)
Returns the cache as a map. This does not imply a snapshot, as implementation might provide a weakly consistent view of the cache.
Returns the cache as a map. This does not imply a snapshot, as implementation might provide a weakly consistent view of the cache.
(cache-as-map this region-cache)
Return all entries for a RegionCache.
Return all entries for a RegionCache.
(get-cached* this region-cache args)
Return the cache value for the function and args, possibly invoking the function.
Return the cache value for the function and args, possibly invoking the function. - region-cache is RegionCache instance This should be a thread-safe atomic operation.
(invalidate* this region-cache args)
Invalidate an arglist for RegionCache
Invalidate an arglist for RegionCache
(invalidate-cached this region-cache)
Invalidate all keys stemming from this RegionCache
Invalidate all keys stemming from this RegionCache
(invalidate-region this)
Invalidate all entries, returns Region
Invalidate all entries, returns Region
(put-all* this region-cache args-to-vals)
Add entries to RegionCache
Add entries to RegionCache
Creates a cache for a function with the spec.
Creates a cache for a function with the spec.
(direct-spec spec)
The spec given directly (not from var or fn meta) can have non-namespaced keys, which we will namespace.
The spec given directly (not from var or fn meta) can have non-namespaced keys, which we will namespace.
(new-region region-id raw-spec default-type)
Convenience function for making new regions
Convenience function for making new regions
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close