Skip to main content

No project description provided

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-4.0.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

pop_evbus-4.0.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pop-evbus-4.0.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for pop-evbus-4.0.1.tar.gz
Algorithm Hash digest
SHA256 c0b09ce1b854a88076125813774640a115d0a55a78aba0d3067a503a72332f8a
MD5 066614a5d361c952c8e3c515e982c4ab
BLAKE2b-256 234cb2b2cf9cf0000607bbcff7c2e2dd451dcf6ac54da98204ea3ee0f6c1ce2c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pop_evbus-4.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for pop_evbus-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bf631ab9c81c0a204490d80d157784154f3fe65286c331813017d6f8c5f2f5b
MD5 916c8e336e15b76e1af3fe9f254d96aa
BLAKE2b-256 82600c426c1560eed5e743fb78430c2f363dabc11bf4ddcc16e5573cdadca6ae

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