Skip to main content

Event propagation to configured ingress plugins

Project description

An asynchronous message ingress system. evbus is an app-merge component for larger projects. Events are put on a broker queue. A listener watches the broker queue and propagates events to configured ingress queues.

INSTALLATION

Install from pypi

pip install pop-evbus

Install locally with testing libraries:

$ git clone git@gitlab.com:vmware/idem/evbus.git
$ pip install -e evbus -r evbus/requirements/test.in

Firing Events

There are two functions that will put an event into the broker queue; put and put_nowait The only difference between them is that put is asynchronous and put_nowait is synchronous. Both accept a routing_key, body, and profile.

routing_key

This option is forwarded to the ingress plugins’ publish functions. Some message queues take a routing_key option themselves, some need to open a channel on the message queue for the named routing_key. It’s up to the ingress plugins to implement this appropriately for the message queue they wrap.

body

The event body is serialized by the evbus broker when it is put on the broker Queue. The body can be any serializable object. The serializer can be configured by setting hub.serialize.PLUGIN to the name of the plugin that should be used.

profile

Configured profiles are formatted as follows:

provider:
  profile_name:
      profile_data:

The profile parameter for the broker put and put_nowait functions specifies which profile_name should be used for firing an event. If no profile is specified, the profiles called “default” will be used. There can be multiple providers with the same profile name, the event will be forwarded to all providers that have a matching profile name. A context (ctx) will be generated that will be sent to the appropriate ingress plugin’s publish function based on profile.

Full Example

Asynchronous put:

async def my_func(hub):
    await hub.evbus.broker.put(
        routing_key="channel", body={"message": "event content"}, profile="default"
    )

Synchronous put:

def my_func(hub):
    hub.evbus.broker.put_nowait(
        routing_key="channel", body={"message": "event content"}, profile="default"
    )

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

pop-evbus-6.1.3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

pop_evbus-6.1.3-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pop-evbus-6.1.3.tar.gz.

File metadata

  • Download URL: pop-evbus-6.1.3.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.4 keyring/23.6.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for pop-evbus-6.1.3.tar.gz
Algorithm Hash digest
SHA256 24576aa48087ce2987bc87b7ea05f7c39cf7446aec2d9496a8b2136bf5e75c1a
MD5 f9185e73deeb423403b36490d5ec1270
BLAKE2b-256 89e954eef08d5e3e8fe39a72db5d87d935086df686c8fed5c023bd926a2a9a8d

See more details on using hashes here.

File details

Details for the file pop_evbus-6.1.3-py3-none-any.whl.

File metadata

  • Download URL: pop_evbus-6.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.4 keyring/23.6.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for pop_evbus-6.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 96f4cbb518cf90d1f93809a947b8f6d071d1a654e2bba8b23009289e597a4b42
MD5 2c411ca22373a4953357add6d5d11f78
BLAKE2b-256 0382d85d8d9903fa2b9fb1ef0b9c871782aac89d787178045cfdcc4120b13b23

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