Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedrokiefer/aiostomp
AsyncIO Stomp Client
https://github.com/pedrokiefer/aiostomp
asyncio client python python36 stomp
Last synced: 18 days ago
JSON representation
AsyncIO Stomp Client
- Host: GitHub
- URL: https://github.com/pedrokiefer/aiostomp
- Owner: pedrokiefer
- License: mit
- Created: 2018-01-16T15:20:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-25T17:00:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T09:39:27.894Z (about 1 month ago)
- Topics: asyncio, client, python, python36, stomp
- Language: Python
- Size: 115 KB
- Stars: 22
- Watchers: 3
- Forks: 18
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/pedrokiefer/aiostomp.png?branch=master)](https://travis-ci.com/pedrokiefer/aiostomp)
[![Coverage Status](https://coveralls.io/repos/github/pedrokiefer/aiostomp/badge.svg?branch=master)](https://coveralls.io/github/pedrokiefer/aiostomp?branch=master)
[![PyPI version](https://badge.fury.io/py/aiostomp.svg)](https://badge.fury.io/py/aiostomp)# Aiostomp
Simple asyncio stomp 1.1 client for python 3.6.
Heavely inspired on [torstomp](https://github.com/wpjunior/torstomp).
## Install
with pip:
```bash
pip install aiostomp
```## Usage
```python
import sys
import logging
import asynciofrom aiostomp import AioStomp
logging.basicConfig(
format="%(asctime)s - %(filename)s:%(lineno)d - "
"%(levelname)s - %(message)s",
level='DEBUG')async def run():
client = AioStomp('localhost', 61613, error_handler=report_error)
client.subscribe('/queue/channel', handler=on_message)await client.connect()
client.send('/queue/channel', body=u'Thanks', headers={})
async def on_message(frame, message):
print('on_message:', message)
return Trueasync def report_error(error):
print('report_error:', error)def main(args):
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
loop.run_forever()if __name__ == '__main__':
main(sys.argv)```
## 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.