Foundry. Context. Cache
(foundry v0.1.3)
Copy Markdown
ETS-backed cache for module context data.
Provides get_or_compute/3 to cache expensive operations like
SparkMeta.walk/1 results.
This is a Phase 1 stub using process-local caching. Will be upgraded to Nebulex L1 (Hex dependency) in Phase 3+ when Nebulex is added.
Summary
Functions
Get a cached value or compute it if not present.
Functions
Get a cached value or compute it if not present.
CONCURRENCY NOTE: This is a best-effort cache (last-write-wins on race). Two concurrent calls with a cold cache will both compute and both put. This is acceptable because: (1) SparkMeta.walk/1 is idempotent, (2) test environment is single-threaded with async: false, (3) real projects are read-heavy on modules. If atomicity becomes critical, add a lock.