__init__¶
-
MemcachedCache.
__init__
(use_pickle: bool = None, mcache_instance: pylibmc.client.Client = None, *args, **kwargs)[source]¶ MemcachedCache by default uses the global Memcached instance from
privex.helpers.plugin
.It’s recommended to use
privex.helpers.plugin.configure_memcached()
if you need to change any Memcached settings, as this will adjust the global settings and re-instantiate the global instance if required.Alternatively, you may pass an instance of
pylibmc.Client
asmcache_instance
, then that will be used instead of the global instance fromget_memcached()
- Parameters
use_pickle (bool) – (Default:
True
) Use the built-inpickle
to serialise values before storing in Memcached, and un-serialise when loading from Memcachedmcache_instance (pylibmc.Client) – If this isn’t
None
/False
, then this Memcached instance will be used instead of the global one fromget_memcached()
enter_reconnect (bool) – Pass
enter_reconnect=False
to disable callingreconnect()
when entering this cache adapter as a context manager (__aenter__()
)exit_close (bool) – Pass
exit_close=False
to disable callingclose()
when exiting this cache adapter as a context manager (__aexit__()
)