EDA.Cache.Adapter.NoOp (EDA v0.5.0-beta.2)

Copy Markdown View Source

An EDA.Cache.Adapter that stores nothing.

Every write is discarded and every read misses, so EDA.Cache.get_guild/1 and friends always return nil and the fetch_* functions fall through to REST on every call.

config :eda, cache_adapter: EDA.Cache.Adapter.NoOp

Useful for a memory-constrained bot that would rather pay the HTTP cost, for a stateless worker that keeps no guild state, and in tests where cached state leaking between cases is a nuisance.

Prefer a policy for partial caching

This turns off all caches. To keep some entities and drop others, leave the ETS adapter in place and use a per-entity admission policy instead — see EDA.Cache:

config :eda, cache: [presences: [policy: :none], members: [policy: :none]]