Event

In Ops, 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. When creating a charm, you write charms and implement handlers that respond to events and state changes communicated by Juju 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 3 months ago. Help improve this document in the forum.