RabbitMQ Stream Python Client
A Python asyncio-based client for RabbitMQ Streams
This is a work in progress
Install
pip install rstream
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:
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.2.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.2.1.tar.gz | 13.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rstream-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.8 kB
Release files / rstream-0.2.1.tar.gz
| Download URL | rstream-0.2.1.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc7f821b9e356a73973bd73192c9458f300d91f60ce4e919440b0c91fb11374f
|
|
BLAKE2b-256 checksum How to use checksums |
290f4037277bee048d58c207f457f83156f6a3c649cdb6d962599b4d870a5fa6
|
| 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.2.1-py3-none-any.whl
| Download URL | rstream-0.2.1-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f65fa3474b39b08f06229ae5962bc9e8fbb368a4f82471b8a37fac9aca386a9
|
|
BLAKE2b-256 checksum How to use checksums |
18d99d7ccb63fc9226e745f3459576e412ddf1af174c485edb75ca8950a2c76a
|
| 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
|