From a77bfc93a61bb9f8b7c2c5a3e58b16e72dca5a30 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Thu, 11 Nov 2010 09:05:46 +0100 Subject: [PATCH] Redis: Add Channel.Client so the Redis client can be overridden --- kombu/transport/pyredis.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kombu/transport/pyredis.py b/kombu/transport/pyredis.py index a450ee53..5207f07a 100644 --- a/kombu/transport/pyredis.py +++ b/kombu/transport/pyredis.py @@ -102,6 +102,8 @@ class ChannelPoller(Thread): class Channel(virtual.Channel): + Client = Redis + _client = None supports_fanout = True keyprefix_fanout = "_kombu.fanout.%s" @@ -176,10 +178,10 @@ class Channel(virtual.Channel): raise ValueError( "Database name must be int between 0 and limit - 1") - return Redis(host=conninfo.hostname, - port=conninfo.port or DEFAULT_PORT, - db=database, - password=conninfo.password) + return self.Client(host=conninfo.hostname, + port=conninfo.port or DEFAULT_PORT, + db=database, + password=conninfo.password) @property def client(self):