From aceaa7195690c0500e18f7fc95fee105fa1f2ecc Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Mon, 12 Sep 2011 12:57:12 +0100 Subject: [PATCH] Improve example code --- examples/simple_task_queue/worker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/simple_task_queue/worker.py b/examples/simple_task_queue/worker.py index 0fa4c261..8b521a43 100644 --- a/examples/simple_task_queue/worker.py +++ b/examples/simple_task_queue/worker.py @@ -32,4 +32,7 @@ if __name__ == "__main__": setup_logging(loglevel="INFO") with BrokerConnection("amqp://guest:guest@localhost:5672//") as conn: - Worker(conn).run() + try: + Worker(conn).run() + except KeyboardInterrupt: + print("bye bye")