Exemple #1
0
    def __init__(self):
        super(MatchMakerRedis, self).__init__()

        if not redis:
            raise ImportError("Failed to import module redis.")

        self.redis = redis.StrictRedis(host=CONF.matchmaker_redis.host,
                                       port=CONF.matchmaker_redis.port,
                                       password=CONF.matchmaker_redis.password)

        self.add_binding(mm_common.FanoutBinding(), RedisFanoutExchange(self))
        self.add_binding(mm_common.DirectBinding(), mm_common.DirectExchange())
        self.add_binding(mm_common.TopicBinding(), RedisTopicExchange(self))
Exemple #2
0
 def __init__(self, ring=None):
     super(MatchMakerRing, self).__init__()
     self.add_binding(mm.FanoutBinding(), FanoutRingExchange(ring))
     self.add_binding(mm.DirectBinding(), mm.DirectExchange())
     self.add_binding(mm.TopicBinding(), RoundRobinRingExchange(ring))