Edacious an Event Derive Architecture framework
Project description
Edacious an Event Derive Architecture framework
Implementing an EDA usually requires a queue mechanism. Currently support Redis streams and Amazon Web Services SQS.
Event must be a dict that contain data to be processed.
Every event must have an event type (str) attribute, reserve key is event-type
.
To process an event the event type has to be associated to one or more event handlers.
Event handler is a function that receive an event (dict) and process it, here is an example for running event listener based on Amazon Web Services SQS.
from edacious.sqs import EventListener
SQS_URL = 'https://sqs.my-region.amazonaws.com/123456789012/my-app-sqs'
@event_handler(event_type='hello-world')
def my_handler(event: dict):
print(event)
if __name__ == '__main__':
listener = EventListener(sqs_url=SQS_URL, visibility_timeout=60, max_messages_to_fetch=10)
listener.set_seconds_to_wait(seconds=2.5)
listener.run()
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
edacious-0.0.10.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for edacious-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fec593b825ff0b934a507edc1808e1222add26967a651ef629da3fbbc618845 |
|
MD5 | 27fb5df426ad691d252b457363130f2a |
|
BLAKE2b-256 | a7b4ae1e9c4323748559c1b28d4830e692359efb185dfd1c163930ce652a282e |