def __init__(self, settings): self._dbname = settings.get('xpool_db', 'cache') self._holding = cache.SetCache('cache', 'proxy_holding', 60 * 60) self._caching = cache.ZsetCache('cache', 'proxy_caches', 4 * 60 * 60) self._xfwd = cache.HashCache('cache', 'proxy_xfwd', 24 * 60 * 60) self._conf = self._DefaultConf.copy() self._redis = API.redis(self._dbname)
def __init__(self, settings): self._dbname = settings.get('xpool_db', 'cache') self._holding = cache.SetCache('cache','proxy_holding', 60*60) self._caching = cache.ZsetCache('cache','proxy_caches', 4*60*60) self._xfwd = cache.HashCache('cache','proxy_xfwd', 24*60*60) self._conf = self._DefaultConf.copy() self._redis = API.redis(self._dbname)
def __init__(self, dbname, name, timeout): self._timeout = timeout self._dbname = dbname self._keyname = name self._redis = API.redis(self._dbname) self._ns = { 'data': API.ns_of(self._keyname), }
def setUp(self): self.redis = API.redis('default')
def cache_zset(ctrl, message): _name = message.get('db', 'default') API.redis(_name).zrem( API.ns_of( message['zset'] ), message['value'] )
def cache_hash(ctrl, message): _name = message.get('db', 'default') API.redis(_name).hdel( API.ns_of( message['hash'] ), message['field'] )