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.3.tar.gz
(13.9 kB
view details)
Built Distribution
File details
Details for the file zimran-events-0.3.3.tar.gz
.
File metadata
- Download URL: zimran-events-0.3.3.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4541332cca40b564554958956aef0e7b553d2bbb4b0d238ec528051114bc6e8c |
|
MD5 | feb2819c9828c805a4bccc196d3bbd6b |
|
BLAKE2b-256 | 17bd3c3fd9228eda2b72603127c91c0b6277476874e6ab736de2863d2a7cbc90 |
File details
Details for the file zimran_events-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: zimran_events-0.3.3-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.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1ea66d6180e5e313f62edfd7354bfa81de7d0525243c3e2abe8ba2a4bb68227 |
|
MD5 | bc9e5c712c943195e0cbb68412b1b42c |
|
BLAKE2b-256 | 55d9a15cac85dc9c146a6f199cd69f1f661239339c04d7a15b88726b63f7b041 |