From 387e9798401ad77476a235d9fd145b5ea1de7988 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Fri, 7 Jan 2011 11:11:22 +0100 Subject: [PATCH] Implement connection revive() for kombu.compat classes --- kombu/compat.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kombu/compat.py b/kombu/compat.py index 6c85c472..6d4064ae 100644 --- a/kombu/compat.py +++ b/kombu/compat.py @@ -100,6 +100,10 @@ class Publisher(messaging.Producer): def send(self, *args, **kwargs): return self.publish(*args, **kwargs) + def revive(self, channel): + self.backend = channel + super(Publisher, self).revive(channel) + def close(self): self.backend.close() self._closed = True @@ -153,6 +157,10 @@ class Consumer(messaging.Consumer): auto_delete=self.auto_delete) super(Consumer, self).__init__(self.backend, queue, **kwargs) + def revive(self, channel): + self.backend = channel + super(Consumer, self).revive(channel) + def close(self): self.cancel() self.backend.close() @@ -233,6 +241,10 @@ class ConsumerSet(messaging.Consumer): for queue in consumer.queues: self.queues.append(queue(self.channel)) + def revive(self, channel): + self.backend = channel + super(ConsumerSet, self).revive(channel) + def close(self): self.cancel() self.channel.close()