Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Functions

publish(name, attributes, time_to_live=None)

Publish a Universal Event to the associated Universal Controller.

  • Can be called at any time by an Extension instance.
  • Universal Events are optionally defined in the Universal Extension Template as part of the Universal Extension definition.

Parameters

name : str

The name of a target event defined in the Controller.

attributes : dict

the attributes of the event

time_to_live : int, optional

maximum time (in minutes) the event can live. If no value is specified, the default value from the Universal Event Template will be used.

Returns

None


Examples

>>> from universal_extension import event

>>> event_attributes = {}

>>> event_attributes["attribute_1"] = "value_1"

>>> event_attributes["attribute_2"] = "value_2"

>>> event_attributes["attribute_3"] = "value_3"

>>> event.publish("my_event", event_attributes, 20)

  • No labels