Metastatic.Cache (Metastatic v0.26.0)

View Source

AST Caching layer for Metastatic.

Caches the results of parsing and abstracting source code to MetaAST (M2). Uses a public ETS table for high-performance memory cache.

Summary

Functions

Clear all cached entries.

Get cached abstraction result (MetaAST + Metadata) for a source code string and language.

Initialize the cache ETS table. Called automatically during application startup.

Store abstraction result in cache.

Functions

clear()

@spec clear() :: :ok

Clear all cached entries.

get(adapter, source)

@spec get(module(), String.t()) :: {:ok, term(), map()} | {:error, :not_found}

Get cached abstraction result (MetaAST + Metadata) for a source code string and language.

Returns {:ok, meta_ast, metadata} if found, or {:error, :not_found}.

init()

@spec init() :: :ok

Initialize the cache ETS table. Called automatically during application startup.

put(adapter, source, meta_ast, metadata)

@spec put(module(), String.t(), term(), map()) :: :ok

Store abstraction result in cache.