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.1.tar.gz
(12.3 kB
view details)
Built Distribution
File details
Details for the file zimran-events-0.2.1.tar.gz
.
File metadata
- Download URL: zimran-events-0.2.1.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4243d371defe072f72fc5ebcd5a36d77cd89d0fe7e1d0db654a0ee79439b3b88 |
|
MD5 | 30b3ff912287a8e594bc509c927c6cf0 |
|
BLAKE2b-256 | 0480c570379a7a91f2fd25777d3b62043c221e705bd3a847b9d66d96b4953d70 |
File details
Details for the file zimran_events-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: zimran_events-0.2.1-py3-none-any.whl
- Upload date:
- Size: 9.0 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 | 21cfc390bd6531e5c3aadf178c7df9e530dca833f65d0df1f345d236d9769ac7 |
|
MD5 | bf6d6f0da540e39a2508fbda00cfefa1 |
|
BLAKE2b-256 | 84189385f21bca2f4048f0a9ac313271d0b8c64c55c38a77b679a7d3cbd55e83 |