mirror of https://github.com/celery/kombu.git
Redis: Add Channel.Client so the Redis client can be overridden
This commit is contained in:
parent
d52c6130e9
commit
a77bfc93a6
|
@ -102,6 +102,8 @@ class ChannelPoller(Thread):
|
||||||
|
|
||||||
|
|
||||||
class Channel(virtual.Channel):
|
class Channel(virtual.Channel):
|
||||||
|
Client = Redis
|
||||||
|
|
||||||
_client = None
|
_client = None
|
||||||
supports_fanout = True
|
supports_fanout = True
|
||||||
keyprefix_fanout = "_kombu.fanout.%s"
|
keyprefix_fanout = "_kombu.fanout.%s"
|
||||||
|
@ -176,10 +178,10 @@ class Channel(virtual.Channel):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Database name must be int between 0 and limit - 1")
|
"Database name must be int between 0 and limit - 1")
|
||||||
|
|
||||||
return Redis(host=conninfo.hostname,
|
return self.Client(host=conninfo.hostname,
|
||||||
port=conninfo.port or DEFAULT_PORT,
|
port=conninfo.port or DEFAULT_PORT,
|
||||||
db=database,
|
db=database,
|
||||||
password=conninfo.password)
|
password=conninfo.password)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def client(self):
|
def client(self):
|
||||||
|
|
Loading…
Reference in New Issue