The zimran-events provides amqp interface
Project description
zimran-contrib
The zimran-py-events
module provides AMQP interface
Installation
pip install zimran-events
Usage example
Producer
from zimran.events import AsyncProducer
producer = AsyncProducer(broker_url='')
await producer.connect()
# message publishing
await producer.publish('some.event.routing', {'msg': 'hello, world'})
Consumer
from zimran.events import Consumer
from zimran.events.schemas import ExchangeScheme
consumer = Consumer(service_name='my-service', broker_url='')
consumer.add_event_handler(
name='routing-key',
handler=handler_func,
exchange=ExchangeScheme(
name='exchange-name',
type='exchange-type',
durable=True,
)
)
# or
from zimran.events import Consumer
consumer = Consumer(service_name='my-service', broker_url='')
@consumer.event_handler('routing-key')
def handler_func(**kwargs):
...
Code
The code and issue tracker are hosted on GitHub: https://github.com/zimran-tech/zimran-py-events.git
Features
- AMQP interfaces
For contributors
Setting up development environment
Clone the project:
git clone https://github.com/zimran-tech/zimran-py-events.git
cd zimran-py-events
Create a new virtualenv:
python3 -m venv venv
source venv/bin/activate
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zimran-events-0.2.6.tar.gz
(12.7 kB
view details)
Built Distribution
File details
Details for the file zimran-events-0.2.6.tar.gz
.
File metadata
- Download URL: zimran-events-0.2.6.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad05b3940a8f3408d42912d1ed0580904605d587493f9dca9327b414901aef28 |
|
MD5 | bea0eda7cb3a67c9ca39245015c34d15 |
|
BLAKE2b-256 | 88aaa560cabc5396fbc5e76c2c74cf0390cf8bc8c58c9644c5553275f2a1404b |
File details
Details for the file zimran_events-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: zimran_events-0.2.6-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb9b4979079f072d2d928beefbf68c8cd560f2fa8f05da9fa2cda551cb11b291 |
|
MD5 | ec36d51996e9e3e14750267ba2b34f78 |
|
BLAKE2b-256 | 0002164d63919c2e888f2b0afa726159c9054d92bd558571087a49b85e7b9197 |