def sadd(self, rs, timeout=None): timeout = timeout or self._timeout rs = misc.makelist(rs) _rs = self._redis.sadd(self._ns['data'], *rs) self._expire(rs, timeout) return _rs
def _wrapper(*args, **kwds): callback = fun _cb = misc.makelist(plugins) _cb.reverse() for e in _cb: callback = e(callback) return callback(*args, **kwds)
def expire(msg, timeout=3600, dbname='cache'): rs = misc.makelist(msg) for e in rs: API.redis(dbname).setex('~%s' % json.dumps(e), '', timeout)
def queue_bpop(nss, timeout=60, dbname='default'): nss = [API.ns_of(e) for e in misc.makelist(nss)] res = API.redis(dbname).blpop(nss, timeout=timeout) if not res: return None, None return API._short(res[0]), res[1]
def expire_rem(msg, dbname='cache'): rs = misc.makelist(msg) rs = ('~%s' % json.dumps(e) for e in rs) API.redis(dbname).delete(*rs)
def expire_rem( msg, dbname='cache'): rs = misc.makelist(msg) rs = ('~%s'%json.dumps(e) for e in rs) API.redis(dbname).delete(*rs)
def expire( msg, timeout=3600, dbname='cache'): rs = misc.makelist(msg) for e in rs: API.redis(dbname).setex( '~%s'%json.dumps(e),'',timeout)
def queue_bpop( nss, timeout=60, dbname='default'): nss = [API.ns_of(e) for e in misc.makelist(nss)] res = API.redis(dbname).blpop(nss,timeout=timeout) if not res: return None,None return API._short(res[0]), res[1]
def _expire_rem(self, v): vv = misc.makelist(v) API.expire_rem(map(self._cache_info, vv))
def _expire(self, v, timeout=None): vv = misc.makelist(v) timeout = timeout or self._timeout API.expire( map(self._cache_info,vv), timeout=timeout)
def _expire(self, v, timeout=None): vv = misc.makelist(v) timeout = timeout or self._timeout API.expire(map(self._cache_info, vv), timeout=timeout)