Library for inter-service event-based communication
Project description
Inter-service event communication
This library handles inter (micro)services communication in a decoupled way using the event/observer pattern.
The code raises an event when something happens and that event fires notifications to the registered listeners.
Implemented notifications are:
- Celery task
- HTTP request
YAML file configuration
Can be configured with a yaml file like this, passed as initialization argument or in environment variable EVENTISC_CONFIG
name_prefix: myapp.
listeners:
- kind: http
event_name: myapp.user_created
url: http://notification-service.mycompany.com/send-welcome/
requests_kwargs:
auth: ["myuser", "password"]
request_format: json
data:
user_id: "{event_data['user'].id}"
email: "{event_data['user'].email}"
- kind: celery
event_name_regex: myapp[.].*_created
queue: foo_service
task_name: foo_handle_created
task_kwargs:
event_name: {event_name}
event_data: {event_data}
Usage
import eventisc
...
eventisc.trigger("user_created", {"user": user}) # Should fire both listeners
eventisc.trigger("foo_created", {"foo": "bar"}) # Should fire only celery
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
event-isc-0.1.0.tar.gz
(10.6 kB
view details)
Built Distribution
File details
Details for the file event-isc-0.1.0.tar.gz
.
File metadata
- Download URL: event-isc-0.1.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.26.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 303e0049cf17946a93cc85846a1c4558237842425379dc13d4858b1ce323dafe |
|
MD5 | 3f1d881a810ca654dfce99dd4dd36fcd |
|
BLAKE2b-256 | fc31079b7cebb4eaac0434030cc52ccdc4b31c82d62d8ba01e81531f6b652bb6 |
File details
Details for the file event_isc-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: event_isc-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.26.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10ddf7a3a1a8ff694a10645603582c01b8d00d6b381b1a80215b82f2b8dc4e5f |
|
MD5 | b864b0fd78e541cada41b2b4fed77131 |
|
BLAKE2b-256 | 499910fdabee607ad43f29e2235432a751363a54efff40c3170e3934470603d2 |