get_adapter¶
-
classmethod
CacheWrapper.get_adapter(default: Union[Type[privex.helpers.cache.CacheAdapter.CacheAdapter], Type[privex.helpers.cache.asyncx.base.AsyncCacheAdapter]] = 'memory', *args, **kwargs) → Union[privex.helpers.cache.CacheAdapter.CacheAdapter, privex.helpers.cache.asyncx.base.AsyncCacheAdapter][source]¶ Attempt to get the singleton cache adapter from
cache_instance- if the instance isNone, then attempt to instantiatedefault()If any
*argsor**kwargsare passed, they will be passed through todefault(*args, **kwargs)so that any necessary configuration parameters can be passed to the class.