Metadata-Version: 2.1
Name: aiostomp
Version: 1.7.3
Summary: Stompt Client for Asyncio applications
Author: Pedro Kiefer
Author-email: Pedro Kiefer <pedro@kiefer.com.br>
License: MIT
Project-URL: Source Code, https://github.com/pedrokiefer/aiostomp
Keywords: stomp,asyncio,client
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: six
Requires-Dist: async-timeout
Provides-Extra: tests
Requires-Dist: mock ; extra == 'tests'
Requires-Dist: coverage ; extra == 'tests'
Requires-Dist: asynctest ; extra == 'tests'
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: pytest-cov ; extra == 'tests'
Requires-Dist: flake8 ; extra == 'tests'
Requires-Dist: bumpversion ; extra == 'tests'

[![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 asyncio

from 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 True


async 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.
