Set Timeout for Pika ioloop async (RabbitMQ)
问题 I need to be able to gracefully stop a consumer (worker) who works in a Pika ioloop. The worker should stop after 60 seconds. Currently processed messages should be finished. I tried to put a connection.close() inside the callback function but that only stopped the current thread and not the complete ioloop. And it gave a terrible error output. Please see line 16 and following in my code: I used the (basic example about Pika ioloop http://pika.github.com/connecting.html#cps-example: from pika