Actions
Actions are associated with conditions. A condition can contain multiple actions. The actions are executed whenever the corresponding condition is true. Actions within a condition execute in FIFO order (the order in which they were added into the condition). Multiple conditions that are true are triggered simultaneously in an arbitrary order. Conditions specified as HCONDINDEPENDENT will execute in a separate thread of execution, in parallel with other conditions. (See the section Condition functions in this chapter.)
The HAM API includes several functions for different kinds of actions:
Action | Description |
---|---|
ham_action_restart() | This action restarts the entity. |
ham_action_execute() | Executes an arbitrary command (e.g., to start a process). |
ham_action_notify_pulse() | Notifies some process that this condition has occurred. This notification is sent using a specific pulse with a value specified by the process that wished to receive this notify message. |
ham_action_notify_signal() | Notifies some process that this condition has occurred. This notification is sent using a specific realtime signal with a value specified by the process that wished to receive this notify message. |
ham_action_waitfor() | This action lets you insert delays between consecutive actions in a sequence. You can also wait for certain names to appear in the namespace. |
ham_action_heartbeat_healthy() | Resets the heartbeat mechanism for an entity that had previously missed sending heartbeats, and had triggered a missed heartbeat condition, but has now recovered. |
ham_action_log() | This allows one to insert a customizable verbosity message into the activity log maintained by a HAM. |
Actions are also associated with symbolic names, which are unique within a specific condition.