From 61a40f86598ec0a343bb81491cfca824562dc8ba Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Thu, 11 Nov 2010 11:23:46 +0100 Subject: [PATCH] Redis: Close channel poller thread on finalization --- kombu/transport/pyredis.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kombu/transport/pyredis.py b/kombu/transport/pyredis.py index c960177c..cbf269e8 100644 --- a/kombu/transport/pyredis.py +++ b/kombu/transport/pyredis.py @@ -14,6 +14,7 @@ from Queue import Empty, Queue as _Queue from anyjson import serialize, deserialize from kombu.transport import virtual +from kombu.utils.finalize import Finalize DEFAULT_PORT = 6379 DEFAULT_DB = 0 @@ -40,6 +41,8 @@ class ChannelPoller(Thread): self.poll_request = Condition(self.mutex) self.shutdown = Event() self.stopped = Event() + self._on_collect = Finalize(self, self.close) + Thread.__init__(self) self.setDaemon(False) self.started = False