From 4cb493f22bfb1ff1ac6e08d507cf365215911b13 Mon Sep 17 00:00:00 2001 From: Iddo Date: Fri, 22 Dec 2017 19:15:24 +0200 Subject: [PATCH] reverted kombu_manager.py and zmq_manager.py to not use **kwargs in their manager initialization RedisManager totalizator can now optionally get an existing redis connection to use rather than a URL --- socketio/kombu_manager.py | 2 +- socketio/redis_manager.py | 9 +++++---- socketio/zmq_manager.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/socketio/kombu_manager.py b/socketio/kombu_manager.py index c699ca0..9906673 100644 --- a/socketio/kombu_manager.py +++ b/socketio/kombu_manager.py @@ -38,7 +38,7 @@ class KombuManager(PubSubManager): # pragma: no cover name = 'kombu' def __init__(self, url='amqp://guest:guest@localhost:5672//', - channel='socketio', write_only=False, **kwargs): + channel='socketio', write_only=False): if kombu is None: raise RuntimeError('Kombu package is not installed ' '(Run "pip install kombu" in your ' diff --git a/socketio/redis_manager.py b/socketio/redis_manager.py index 34ce594..de614eb 100644 --- a/socketio/redis_manager.py +++ b/socketio/redis_manager.py @@ -33,14 +33,15 @@ class RedisManager(PubSubManager): # pragma: no cover name = 'redis' def __init__(self, url='redis://localhost:6379/0', channel='socketio', - write_only=False, **kwargs): + write_only=False, connection=None): if redis is None: raise RuntimeError('Redis package is not installed ' '(Run "pip install redis" in your ' 'virtualenv).') - self.redis = redis.Redis.from_url(url) - if "client_name" in kwargs: - self.redis.client_setname(kwargs["client_name"]) + if connection is not None: + self.redis = connection + else: + self.redis = redis.Redis.from_url(url) self.pubsub = self.redis.pubsub() super(RedisManager, self).__init__(channel=channel, write_only=write_only) diff --git a/socketio/zmq_manager.py b/socketio/zmq_manager.py index 3a63f07..d8995a0 100644 --- a/socketio/zmq_manager.py +++ b/socketio/zmq_manager.py @@ -50,7 +50,7 @@ class ZmqManager(PubSubManager): # pragma: no cover def __init__(self, url='zmq+tcp://localhost:5555+5556', channel='socketio', - write_only=False, **kwargs): + write_only=False): if zmq is None: raise RuntimeError('zmq package is not installed ' '(Run "pip install pyzmq" in your '