An event-bus application layer, support redis
Simply ASYNC framework to integrate DISTRIBUTED message bus to your application:
- utilize redis pub/sub features in backend
- fast to start and simply configure
- thread-safe and python async-friendly thanks to coroutines contexts
- fault tolerance if some redis instances down for a little time
- scalable thanks to consistent hashing for mapping
topictoinstancewithout cluster setup
Install
pip install aiobus
Usage
import json
import asyncio
import datetime
from aiobus.redis import RedisBus
...
bus = RedisBus(
servers=['192.168.100.1', '192.168.100.2:6380'],
max_pool_size=1000
)
...
# Publisher Coroutine
async def publisher():
while True:
await bus.publish('my-topic', {'stamp': str(datetime.datetime.now())})
await asyncio.sleep(0.1)
...
# Subscriber Coroutine
async def subscriber():
await bus.subscribe('my-topic')
async for msg in await bus.listen():
print(json.dumps(msg, indent=2, sort_keys=True))
...
Demo
- Setup redis instances on localhost
docker-compose up -dfor demo purposes - Run/Debug Demo script
Running tests
Before to run tests you should
- install dependencies:
pip install -r requirements.txt - start the dependent services with command:
docker-compose up -d
Metadata
Release files for aiobus 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiobus-1.0.6.tar.gz | 11.4 kB | Without provenance | Details for aiobus-1.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiobus-1.0.6-py3-none-any.whl | Python 3 | none | any | Details for aiobus-1.0.6-py3-none-any.whl |
Total release size: 22.9 kB
Release files / aiobus-1.0.6.tar.gz
| Download URL | aiobus-1.0.6.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f45f323379c57a0a2af5b7a0bdc9e818d872c9798650806e0f801f9bfa149a1a
|
|
BLAKE2b-256 checksum How to use checksums |
6af5bb4ecb92f84a5f6654f18abb39fa6f6bee40bdee5056386dac4badc62ca6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / aiobus-1.0.6-py3-none-any.whl
| Download URL | aiobus-1.0.6-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8759303ecbc6cf27f196fb5d6ebbbd0ad11de90109ff20382372a1c77eb0511e
|
|
BLAKE2b-256 checksum How to use checksums |
005755e2bf627ba885b27cda016d94f4cace5842964519ec9385ccb91cd0a880
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for aiobus 1.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.