Esempio n. 1
0
    def __init__(self, servers=None, default_timeout=300, key_prefix=None):
        BaseCacheStore.__init__(self, default_timeout)
        if servers is None or isinstance(servers, (list, tuple)):
            if servers is None:
                servers = ['127.0.0.1:11211']
            self._client = importPreferredMemcachedClient(servers)
            if servers is None:
                raise RuntimeError('emcache nai jan')
        else:
            self._client = servers

        self.key_prefix = key_prefix
Esempio n. 2
0
    def __init__(self, servers=None, default_timeout=300, key_prefix=None):
        BaseCacheStore.__init__(self, default_timeout)
        if servers is None or isinstance(servers, (list, tuple)):
            if servers is None:
                servers = ['127.0.0.1:11211']
            self._client = importPreferredMemcachedClient(servers)
            if servers is None:
                raise RuntimeError('emcache nai jan')
        else:
            self._client = servers

        self.key_prefix = key_prefix
Esempio n. 3
0
    def __init__(self, servers=None, keyPrefix=None, defaultTimeout=300, session_class=None):
        _SessionStore.__init__(self, session_class=session_class)

        if isinstance(servers, (list, tuple)):
            client = importPreferredMemcachedClient(servers)
        elif servers is not None:
            client = servers
        else:
            raise RuntimeError('no memcache module.')

        self._memcacheClient = client
        self._memcacheKeyPrefix = keyPrefix
        self._memcacheTimeout = defaultTimeout
Esempio n. 4
0
    def __init__(self,
                 servers=None,
                 keyPrefix=None,
                 defaultTimeout=300,
                 session_class=None):
        _SessionStore.__init__(self, session_class=session_class)

        if isinstance(servers, (list, tuple)):
            client = importPreferredMemcachedClient(servers)
        elif servers is not None:
            client = servers
        else:
            raise RuntimeError('no memcache module.')

        self._memcacheClient = client
        self._memcacheKeyPrefix = keyPrefix
        self._memcacheTimeout = defaultTimeout