In Juju, an event is a data structure that encapsulates part of the execution context of a charm. In particular, it contains information regarding why this specific execution is taking place. In the current framework for creating charms, Ops, one writes charms and implements handlers that respond to events and state changes communicated by the Juju OLM controller using the observer pattern.

The execution context of a charm is expressed in environment variables. For more, see Charm environment variables.

For example:

  • A config-changed event is the data structure used to communicate to the charm that its configuration has changed.
  • A http-relation-departed event is the data structure used to tell the charm that a particular unit is departing the http relation.

See more:

Last updated 24 days ago.