Expand description
Process-global default cache store, built once from config at boot.
Mirrors doido-model’s connection pool: init builds the store described
by the current environment’s cache config and installs it; handlers read it
via store. Apps that want several named stores can still use
crate::CacheRegistry directly.
Functions§
- init
- Builds the cache store from
config/<env>.ymland installs it as the global default, returning a handle. Idempotent: if already initialised, the existing store is returned and the freshly built one discarded. Call once at boot. - set_
store - Installs an already-built store as the global default (e.g. in tests).
Returns
Errwith the store back if one was already installed. - store
- Returns the global cache store, panicking if
init/set_storewas never called. Use from request handlers where boot is guaranteed to have run. - try_
store - Returns the global cache store if installed, else
None.