Commits

John Mitchell committed aa6d803

works

  • Participants
  • Parent commits e294957

Comments (0)

Files changed (2)

+syntax: glob
+*~
+*.pyc
+z.py
+zz.py
+*_flymake.py
+
+# careful with this one:
+*\#
+
+# misc files:
+sumosync.log
+mprof
+
 '''
 
 import amqplib.client_0_8 as amqp
-conn = amqp.Connection()
-chan = conn.channel()
-
-chan.queue_declare('hello', nowait=True)
-chan.exchange_declare(exchange="amq.fanout", type="fanout")
-
-chan.queue_bind(queue="hello", exchange="amq.fanout")
-
 
 class MessageIter(object):
     def __init__(self, chan):
             self._chan.wait()
             yield self._message
 
-        
-if 0:
-    chan.basic_consume(
-        no_ack=True, callback=recv_callback, 
-        consumer_tag="testtag")
-    while True:
-        chan.wait()
-else:
-    for msg in MessageIter(chan):
-        print 'ding',msg
-        
 
+conn = amqp.Connection()
+chan = conn.channel()
 
-# chan.close()
-# conn.close()
+chan.queue_declare('hello', nowait=True)
+chan.exchange_declare(exchange="amq.fanout", type="fanout")
+
+chan.queue_bind(queue="hello", exchange="amq.fanout")
+
+print 'start'
+for msg in MessageIter(chan):
+    print 'ding',msg
+print 'done'        
+
+chan.close()
+conn.close()