Simple tornado stomp 1.1 client.
with pip:
pip install torstomp# -*- coding: utf-8 -*-fromtornadoimportgenfromtornado.ioloopimportIOLoopfromtorstompimportTorStomp@gen.coroutinedefmain(): client=TorStomp('localhost', 61613, connect_headers={'heart-beat': '1000,1000' }, on_error=report_error) client.subscribe('/queue/channel', callback=on_message) yieldclient.connect() client.send('/queue/channel', body=u'Thanks', headers={}) defon_message(frame, message): print('on_message:', message) defreport_error(error): print('report_error:', error) if__name__=='__main__': main() IOLoop.current().start()With empty virtualenv for this project, run this command:
make setupand run all tests =)
make testFork, patch, test, and send a pull request.
