carrot consumer thread fix
This commit is contained in:
@@ -118,13 +118,13 @@ class Connection(carrot_connection.BrokerConnection):
|
|||||||
consumer_set.wait()
|
consumer_set.wait()
|
||||||
except greenlet.GreenletExit:
|
except greenlet.GreenletExit:
|
||||||
return
|
return
|
||||||
if not self._rpc_consumer_thread:
|
if self._rpc_consumer_thread is None:
|
||||||
self._rpc_consumer_thread = eventlet.spawn(_consumer_thread)
|
self._rpc_consumer_thread = eventlet.spawn(_consumer_thread)
|
||||||
return self._rpc_consumer_thread
|
return self._rpc_consumer_thread
|
||||||
|
|
||||||
def cancel_consumer_thread(self):
|
def cancel_consumer_thread(self):
|
||||||
"""Cancel a consumer thread"""
|
"""Cancel a consumer thread"""
|
||||||
if self._rpc_consumer_thread:
|
if self._rpc_consumer_thread is not None:
|
||||||
self._rpc_consumer_thread.kill()
|
self._rpc_consumer_thread.kill()
|
||||||
try:
|
try:
|
||||||
self._rpc_consumer_thread.wait()
|
self._rpc_consumer_thread.wait()
|
||||||
|
|||||||
Reference in New Issue
Block a user