summaryrefslogtreecommitdiff
path: root/examples/hello_publisher.py
diff options
context:
space:
mode:
authorHVN <hvnsweeting@gmail.com>2012-12-11 11:35:02 +0700
committerHVN <hvnsweeting@gmail.com>2012-12-11 11:35:02 +0700
commit6f67983182d6cc9e5fba2e1385db2478d37d9a76 (patch)
tree0c04733fb23abc47c7ddaf00de49349dda76e2c4 /examples/hello_publisher.py
parent920bb3cb73f88673a2abde7329ae9441b200ca66 (diff)
downloadkombu-6f67983182d6cc9e5fba2e1385db2478d37d9a76.tar.gz
merge helloworld into examples
Diffstat (limited to 'examples/hello_publisher.py')
-rw-r--r--examples/hello_publisher.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/hello_publisher.py b/examples/hello_publisher.py
new file mode 100644
index 00000000..dd44c038
--- /dev/null
+++ b/examples/hello_publisher.py
@@ -0,0 +1,10 @@
+from __future__ import with_statement
+from kombu import Connection
+import datetime
+
+with Connection('amqp://guest:guest@localhost:5672//') as conn:
+ simple_queue = conn.SimpleQueue('simple_queue')
+ message = 'helloword, sent at %s' % datetime.datetime.today()
+ simple_queue.put(message)
+ print('Sent: %s' % message)
+ simple_queue.close()