Commits

Anonymous committed ecd9400 Draft

use keyword arguments for InBound and OutBound signature for unified
plugin instantiation

  • Participants
  • Parent commits 9fa517e

Comments (0)

Files changed (1)

araldo_redis/endpoints/redis_endpoint.py

 
 
 class InBound(InBoundBase):
-    def __init__(self, config, gevent_queue, redis_server=None):
+    def __init__(self, **kwargs):
         """ Creates an InBound instance for relaying Redis messages
             :param config: configuration object
             :param gevent_queue: queue for forwarding incoming messages
         """
+        config = kwargs["config"]
+        gevent_queue = kwargs["gevent_queue"]
+        redis_server = kwargs.get("redis_server", None)
         self._channel_name = config["channel"] 
         if not redis_server:
             self._server = redis.Redis(
             raise PluginException("Redis connection problem: %s" % str(error))
 
 class OutBound(OutBoundBase):
-    def __init__(self, config):
+    def __init__(self, **kwargs):
+        config = kwargs["config"]
         self._channel_name = config["channel"] 
         self._server = redis.Redis(
             host=config["host"],