Skip to main content

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:

  1. Celery task
  2. 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.
- kind: http
  event_name: myapp.user_created
    auth: ["myuser", "password"]
  request_format: json
    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
    event_name: {event_name}
    event_data: {event_data}


import eventisc

eventisc.trigger("user_created", {"user": user})  # Should fire both listeners

eventisc.trigger("foo_created", {"foo": "bar"})  # Should fire only celery

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

event-isc-0.1.0.tar.gz (10.6 kB view hashes)

Uploaded source

Built Distribution

event_isc-0.1.0-py2.py3-none-any.whl (7.4 kB view hashes)

Uploaded py2 py3

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