adapter_get¶
-
privex.helpers.cache.
adapter_get
(default: Type[privex.helpers.cache.CacheAdapter.CacheAdapter] = <class 'privex.helpers.cache.MemoryCache.MemoryCache'>) → privex.helpers.cache.CacheAdapter.CacheAdapter[source]¶ Get the global cache adapter instance. If there isn’t one, then by default this function will initialise
MemoryAdapter
and set it as the global cache adapter.To set the global cache adapter instance, use
adapter_set()
To use a different fallback class, pass a class name which implements
CacheAdapter
like so:>>> adapter_get(default=MemoryCache)
- Parameters
default –
- Returns