Skip to main content

The zimran-events provides amqp interface

Project description

zimran-contrib

The zimran-py-events module provides AMQP interface

License: MIT code size

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


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.2.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

zimran_events-0.2.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file zimran-events-0.2.2.tar.gz.

File metadata

  • Download URL: zimran-events-0.2.2.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

Hashes for zimran-events-0.2.2.tar.gz
Algorithm Hash digest
SHA256 414d5e3d952e07e95b5987c6b73bf2c08a864d095cda45c6c1936774b8280af4
MD5 f6603027ffc0c5ce359b36591a7ac612
BLAKE2b-256 978435d7fa10dda5476241a118913479320766703095793bf699ac8a016616af

See more details on using hashes here.

File details

Details for the file zimran_events-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for zimran_events-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f5afb69a7ce16339e3d10523b4c2ca1cd75da91dd89674d0ce3eb5e41c70214
MD5 d3213ff8bd863a3fcf56e37e71c1496c
BLAKE2b-256 466b400687dacc6ad45d729aad3dd52525db77802543d8f9cfd6d0a65c6a2ad8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page