Python library for sending and receiving Eiffel events
Project description
Eiffellib is a python library for subscribing to and publishing Eiffel events to a message-broker.
Description
Eiffellib solves the problem of publishing Eiffel events and subscribing to events, removing the need of knowing how to connect to a message-broker or how to utilize the protocol it supplies.
With Eiffellib you can start subscribing to and publish valid Eiffel messages quickly and to get a feel for the event protocol.
It is designed to be fast and easy to start using while still being production quality.
Documentation: https://eiffellib.readthedocs.io/en/latest/
Features
- Simple subscription and publishing of Eiffel events.
- Event building assistance with event validation on receive and publish.
- Following a context link.
Installation
Install the project for by running:
pip install eiffellib
Examples
Start RabbitMQ
In order for these examples to work you need a RabbitMQ server:
# From https://hub.docker.com/_/rabbitmq docker run -d --hostname my-rabbit --name some-rabbit -p 8080:15672 -p 5672:5672 rabbitmq:3-management
Subscribing to an event
import time from eiffellib.subscribers import RabbitMQSubscriber def callback(event, context): print(event.pretty) SUBSCRIBER = RabbitMQSubscriber(host="127.0.0.1", port=5672, ssl=False, queue="eiffel", exchange="amq.fanout") SUBSCRIBER.subscribe("EiffelActivityTriggeredEvent", callback) SUBSCRIBER.start() while True: time.sleep(0.1)
Publishing an event
from eiffellib.publishers import RabbitMQPublisher from eiffellib.events import EiffelActivityTriggeredEvent PUBLISHER = RabbitMQPublisher(host="127.0.0.1", exchange="amq.fanout", ssl=False, port=5672) PUBLISHER.start() ACTIVITY_TRIGGERED = EiffelActivityTriggeredEvent() ACTIVITY_TRIGGERED.data.add("name", "Test activity") PUBLISHER.send_event(ACTIVITY_TRIGGERED)
Contribute
- Issue Tracker: https://github.com/eiffel-community/eiffel-pythonlib/issues
- Source Code: https://github.com/eiffel-community/eiffel-pythonlib
Support
If you are having issues, please let us know. There is a mailing list at: eiffel-pythonlib-maintainers@google-groups.com or just write an Issue.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size eiffellib-1.2.0-py2.py3-none-any.whl (145.5 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View |
Filename, size eiffellib-1.2.0.tar.gz (40.2 kB) | File type Source | Python version None | Upload date | Hashes View |
Hashes for eiffellib-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eefa42ec2201025078af00123976c73f5cae18b738a56890e28f4c2efb4fc4b |
|
MD5 | b7ea09c28f03643b3f1d014e21a2e004 |
|
BLAKE2-256 | ac358a869e65f9d16287e5fc8bf6bf6288c51fdc68dc288482b2ea0df7af139c |