CentralizedCaches.clear_all_caches!Method
clear_all_caches!(keys...)

Clears all the caches under the listed keys that we are tracking, by calling empty! on them. Remembering that the first (and often only) key is the module the cache was declared from.

Note that calling this without any arguments will clear all caches from all modules. Which might not be safe if e.g. code in a background thread is accessing a cache that you don't know about.

CentralizedCaches.@new_cacheMacro
@new_cache(cache, keys...)

register a new cache (cache) to be tracked by CentralizedCaches The only requirement on T is that it must implement empty!(::T).

This will be tracked by CentralizedCaches.jl, such that it can be cleared using clear_all_caches.

Example useage:

  • @new_cache Dict() creates a new Dict cache registered only by the module
  • @new_cache IdDict() :solves creates a new IdDict cache registered by module name and the key :solves