A basic, dumb cache. SimpleCache
stores cached methods in a simple map of dispatch-value -> effective method; it
offers no facilities to deduplicate identical methods for the same dispatch value. This behaves similarly to the
caching mechanism in vanilla Clojure.
A basic, dumb cache. `SimpleCache` stores cached methods in a simple map of dispatch-value -> effective method; it offers no facilities to deduplicate identical methods for the same dispatch value. This behaves similarly to the caching mechanism in vanilla Clojure.
No vars found in this namespace.
A Cache
implementation that wraps any other cache, watching one or more references (such as an
atom or var), calling clear-cache!
whenever one of those references changes.
WatchingCaches can be created by calling add-watches
on another cache. add-watches
is composable, meaning you
can thread multiple calls to it to build a cache that watches the entire world go by. You could, for example, use
this to build a multifn that supports a dynamic set of hierarchies, letting you add more as you go. The world's your
oyster!
WatchingCaches' watch functions weakly reference their caches, meaning they do not prevent garbage collection of
potentially large method maps; they also automatically clear out their watches when they are garbage collected and
finalized (which, of course, may actually be never -- but worst-case is that some unneeded calls to clear-cache!
get made).
A `Cache` implementation that wraps any other cache, watching one or more references (such as an atom or var), calling `clear-cache!` whenever one of those references changes. WatchingCaches can be created by calling `add-watches` on another cache. `add-watches` is composable, meaning you can thread multiple calls to it to build a cache that watches the entire world go by. You could, for example, use this to build a multifn that supports a dynamic set of hierarchies, letting you add more as you go. The world's your oyster! WatchingCaches' watch functions weakly reference their caches, meaning they do not prevent garbage collection of potentially large method maps; they also automatically clear out their watches when they are garbage collected and finalized (which, of course, may actually be never -- but worst-case is that some unneeded calls to `clear-cache!` get made).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close