The zimran-events provides amqp interface
Project description
zimran-events
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.dto import Exchange
consumer = Consumer(service_name='my-service', broker_url='')
consumer.add_event_handler(
name='routing-key',
handler=handler_func,
exchange=Exchange(
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.3.1.tar.gz
(13.7 kB
view details)
Built Distribution
File details
Details for the file zimran-events-0.3.1.tar.gz
.
File metadata
- Download URL: zimran-events-0.3.1.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21f433cf204f464a0b8c373ba4bad90a905f31fe703091d6167508546cc352d3 |
|
MD5 | fab227914c5bb51213eebd6c76628f99 |
|
BLAKE2b-256 | a0d780c6685d9a6418944c148a3dc3679bcfa3ce95f9383bed0143f32a4dd623 |
File details
Details for the file zimran_events-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: zimran_events-0.3.1-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97761139dbc9cc282dea716abc5509651f7700a9b20d61c0a8bed4d13285910e |
|
MD5 | 53e013619ef67a4415f70d53999104e8 |
|
BLAKE2b-256 | 5239b5f9c4331afab5d54fb9af8ecfa418f1111a934fd0166fa3748bcc25d5f6 |