https://github.com/wpjunior/torstomp
Simple tornado stomp 1.1 client.
https://github.com/wpjunior/torstomp
Last synced: 8 months ago
JSON representation
Simple tornado stomp 1.1 client.
- Host: GitHub
- URL: https://github.com/wpjunior/torstomp
- Owner: wpjunior
- License: mit
- Created: 2015-03-07T01:47:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T12:31:12.000Z (about 9 years ago)
- Last Synced: 2025-09-11T14:30:17.241Z (10 months ago)
- Language: Python
- Size: 38.1 KB
- Stars: 12
- Watchers: 3
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/wpjunior/torstomp)
[](https://coveralls.io/github/wpjunior/torstomp?branch=master)
[](https://badge.fury.io/py/torstomp)
# Torstomp
Simple tornado stomp 1.1 client.
## Install
with pip:
```bash
pip install torstomp
```
## Usage
```python
# -*- coding: utf-8 -*-
from tornado import gen
from tornado.ioloop import IOLoop
from torstomp import TorStomp
@gen.coroutine
def main():
client = TorStomp('localhost', 61613, connect_headers={
'heart-beat': '1000,1000'
}, on_error=report_error)
client.subscribe('/queue/channel', callback=on_message)
yield client.connect()
client.send('/queue/channel', body=u'Thanks', headers={})
def on_message(frame, message):
print('on_message:', message)
def report_error(error):
print('report_error:', error)
if __name__ == '__main__':
main()
IOLoop.current().start()
```
## Development
With empty virtualenv for this project, run this command:
```bash
make setup
```
and run all tests =)
```bash
make test
```
## Contributing
Fork, patch, test, and send a pull request.