Resolves cache configuration at startup and stores it in :persistent_term for O(1) access.
Called once by EDA.Cache.Supervisor before cache processes start.
Example
config :eda,
cache: [
guilds: [],
users: [max_size: 100_000],
members: [policy: :none],
presences: [policy: :none],
channels: [policy: fn _entity, _key, ch ->
if ch["type"] in [0, 2, 5], do: :cache, else: :skip
end]
]
Summary
Functions
Returns all cache key names.
Returns the full config map for a cache.
Returns the max_size for a cache, or nil if unlimited.
Returns the policy for a cache.
Resolves application config and stores in persistent_term. Idempotent.
Functions
@spec cache_keys() :: [atom()]
Returns all cache key names.
Returns the full config map for a cache.
@spec max_size(atom()) :: non_neg_integer() | nil
Returns the max_size for a cache, or nil if unlimited.
Returns the policy for a cache.
@spec setup() :: :ok
Resolves application config and stores in persistent_term. Idempotent.