An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

[![Build Status](https://travis-ci.org/wpjunior/torstomp.png?branch=master)](https://travis-ci.org/wpjunior/torstomp)
[![Coverage Status](https://coveralls.io/repos/github/wpjunior/torstomp/badge.svg?branch=master)](https://coveralls.io/github/wpjunior/torstomp?branch=master)
[![PyPI version](https://badge.fury.io/py/torstomp.svg)](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.