RabbitMQ Stream Python Client
A Python asyncio-based client for RabbitMQ Streams
This is a work in progress
Quick start
Publishing messages:
from rstream import Producer, Consumer
async with Producer('localhost', username='guest', password='guest') as producer:
await producer.create_stream('mystream')
for i in range(100):
await producer.publish('mystream', f'msg: {i}'.encode())
Consuming messages:
async with Consumer('localhost', username='guest', password='guest') as consumer:
async for msg in consumer.iterator('mystream'):
print('Got message:', msg)
if msg.endswith(b'99'):
break
Or with a callback function:
consumer = Consumer(
host='localhost',
port=5552,
vhost='/',
username='guest',
password='guest',
)
loop = asyncio.get_event_loop()
loop.add_signal_handler(signal.SIGINT, lambda: asyncio.create_task(consumer.close()))
def on_message(msg):
print('Got message:', msg)
await consumer.start()
await consumer.subscribe('mystream', on_message)
await consumer.run()
Metadata
Release files for rstream 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rstream-0.1.1.tar.gz | 13.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rstream-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.2 kB
Release files / rstream-0.1.1.tar.gz
| Download URL | rstream-0.1.1.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68ec82d1ca273501db0144ab1c8035b94b53e995eadffc133341e3e72d8a913e
|
|
BLAKE2b-256 checksum How to use checksums |
edbc6387dacfc5b1d2820cd91fcb35d51363cdc8ea5fdc1d323419b9d6f9d0d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.9.5 Linux/5.11.0-25-generic
|
Release files / rstream-0.1.1-py3-none-any.whl
| Download URL | rstream-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90b4b26d317acb183c4be53072123188660cc98a94f15ce1c97a207c4c9346f1
|
|
BLAKE2b-256 checksum How to use checksums |
7aec4028e30b837a86f13b0019ce0c30506e0b3517f34488ca1aa88dd4f451f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.9.5 Linux/5.11.0-25-generic
|