Cache admission policy behaviour and dispatcher.
Controls whether incoming Discord data should be cached or skipped. Used by cache modules to gate writes on the hot path.
Policy values
:all(default) — cache everything:none— cache nothingmodule— a module implementing theEDA.Cache.Policybehaviourfn/3— an anonymous functionfn entity, key, value -> :cache | :skip end
Example
config :eda,
cache: [
presences: [policy: :none],
channels: [policy: fn _entity, _key, ch ->
if ch["type"] in [0, 2, 5], do: :cache, else: :skip
end]
]
Summary
Callbacks
Decides whether the given entity should be cached.
Functions
Dispatches a policy check.