carrot consumer thread fix

This commit is contained in:
Chris Behrens
2011-08-28 19:23:31 -07:00
parent d6cce6e0e4
commit 821b61b386

View File

@@ -118,13 +118,13 @@ class Connection(carrot_connection.BrokerConnection):
consumer_set.wait()
except greenlet.GreenletExit:
return
if not self._rpc_consumer_thread:
if self._rpc_consumer_thread is None:
self._rpc_consumer_thread = eventlet.spawn(_consumer_thread)
return self._rpc_consumer_thread
def cancel_consumer_thread(self):
"""Cancel a consumer thread"""
if self._rpc_consumer_thread:
if self._rpc_consumer_thread is not None:
self._rpc_consumer_thread.kill()
try:
self._rpc_consumer_thread.wait()