Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: da4889b97f
Fetching contributors…

Cannot retrieve contributors at this time

executable file 26 lines (20 sloc) 0.608 kb
#! /usr/bin/env python
import logging
import sys
from tornado.ioloop import IOLoop
from stormed import Connection, Message
# delivery_mode=2 makes message persistent
msg = Message(' '.join(sys.argv[1:]) or 'info: Hello World!')
def on_connect():
ch = conn.channel()
ch.exchange_declare(exchange='logs', type='fanout')
ch.publish(msg, exchange='logs', routing_key='')
conn.close(callback=done)
def done():
print " [x] Sent %r" % msg.body
io_loop.stop()
logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
io_loop.start()
Jump to Line
Something went wrong with that request. Please try again.