Skip to main content

Stompt Client for Asyncio applications

Project description

Build Status Coverage Status PyPI version

Aiostomp

Simple asyncio stomp 1.1 client for python 3.6.

Heavely inspired on torstomp.

Install

with pip:

pip install aiostomp

Usage

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:

make setup

and run all tests =)

make test

Contributing

Fork, patch, test, and send a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiostomp-1.7.3.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

aiostomp-1.7.3-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file aiostomp-1.7.3.tar.gz.

File metadata

  • Download URL: aiostomp-1.7.3.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for aiostomp-1.7.3.tar.gz
Algorithm Hash digest
SHA256 5a367da55fb2ab97f419674e7fa7f3592e53ac7b435a720a6f6a4585faad360b
MD5 229982137e44f0679a3cd53c58dc1dc0
BLAKE2b-256 315bda3ec24fe3d40b24fdbf064d7d74c2152c0a4bfbbeac4e013535f3aa4558

See more details on using hashes here.

File details

Details for the file aiostomp-1.7.3-py3-none-any.whl.

File metadata

  • Download URL: aiostomp-1.7.3-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for aiostomp-1.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 24bb34cc707b5f979bfa028cc8c77ed1f36bd405394cfdd8c182afc27d24aec5
MD5 b1e2c14b74cd931c15a85759532badff
BLAKE2b-256 fa74ea5f40bc923965c01b4bf47eda009f7eed0aac02d862c4c84fd0cf2d0fae

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page