Skip to content

Commit

Permalink
updated redis driver
Browse files Browse the repository at this point in the history
  • Loading branch information
fiorix committed Apr 12, 2011
1 parent 0280016 commit 5162fc5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cyclone/redis/api.py
Expand Up @@ -82,7 +82,7 @@ def disconnect(self):
for conn in self.__ring.nodes:
yield conn.disconnect()
defer.returnValue(True)

def __makering(self, results):
connections = map(operator.itemgetter(1), results)
self.__ring = HashRing(connections)
Expand All @@ -105,22 +105,23 @@ def __wrap(self, method, *args, **kwargs):
#print "node for '%s' is: %s" % (key, node)
f = getattr(node, method)
return f(*args, **kwargs)

def __getattr__(self, method):
if method in [
"get", "set", "getset",
"setnx", "setex",
"incr", "decr", "exists",
"delete", "get_type", "rename",
"expire", "ttl", "push",
"llen", "lrange", "ltrim",
"lindex", "pop", "lset",
"lrem", "sadd", "srem",
"sismember", "smembers",
"lrem", "sadd", "srem",
"sismember", "smembers",
"zadd", "zrem", "zincr",
"zrange", "zrevrange", "zrangebyscore",
"zremrangebyscore", "zcard", "zscore",
"hget", "hset", "hdel", "hincrby", "hlen",
"hkeys", "hvals", "hgetall", "hexists", "hmget", "hmset",
"zremrangebyscore", "zcard", "zscore",
"hget", "hset", "hdel", "hincrby", "hlen",
"hkeys", "hvals", "hgetall", "hexists", "hmget", "hmset",
"publish",
]:
return functools.partial(self.__wrap, method)
Expand Down

0 comments on commit 5162fc5

Please sign in to comment.