summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsk Solem <ask@celeryproject.org>2011-04-05 13:03:14 +0200
committerAsk Solem <ask@celeryproject.org>2011-04-05 13:03:14 +0200
commit1a37e78ac83cc71a6a53eaa27266c59dcb4d7b41 (patch)
tree68a81e22c77b46627c5caf304943af531912730b
parentcc824947e3d69c50de6ee922cf6506af65442e46 (diff)
downloadkombu-1a37e78ac83cc71a6a53eaa27266c59dcb4d7b41.tar.gz
Examples should close connection and channel
-rw-r--r--examples/simple_receive.py4
-rw-r--r--examples/simple_send.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/examples/simple_receive.py b/examples/simple_receive.py
index 276d30cf..6be741c4 100644
--- a/examples/simple_receive.py
+++ b/examples/simple_receive.py
@@ -22,3 +22,7 @@ queue = connection.SimpleQueue("kombu_demo")
message = queue.get(block=True, timeout=10)
message.ack()
print(message.payload)
+
+#: Always remember to close connections and channels.
+queue.close()
+connection.close()
diff --git a/examples/simple_send.py b/examples/simple_send.py
index 11a5e330..d0f1382e 100644
--- a/examples/simple_send.py
+++ b/examples/simple_send.py
@@ -25,3 +25,7 @@ connection = BrokerConnection(hostname="localhost",
#: name, exchange name and routing key.
queue = connection.SimpleQueue("kombu_demo")
queue.put({"hello": "world"}, serializer="json", compression="zlib")
+
+# Always remember to close channels and connections.
+queue.close()
+connection.close()