Add a notify-pulse action to a condition
#include <ha/ham.h> ham_action_t *ham_action_notify_pulse( ham_condition_t *chdl, const char *aname, int nd, pid_t topid, int chid, int pulsecode, int value, unsigned flags); ham_action_t *ham_action_notify_pulse_node( ham_condition_t *chdl, const char *aname, const char *nodename, pid_t topid, int chid, int pulsecode, int value, unsigned flags);
libham
These functions add an action to a given condition. This action will deliver a pulse notification to the process given in topid.
The handle (chdl) is obtained either:
or:
The action is executed when the appropriate condition is triggered.
The nd specifies the node identifier of the remote node (or local node) to which the pulse is targeted The nd specified is the node identifier of the remote node at the time the call is made.
Since node identifiers are transient objects, you should obtain the value for nd immediately before the call, using netmgr_strtond() or another function that converts nodenames into node identifiers. |
Use the ham_action_notify_pulse_node() function when a nodename is used to specify a remote HAM instead of a node identifier (nd). The ham_action_notify_pulse_node() function takes as a parameter a fully qualified node name (FQNN)
The pulse in pulsecode with the given value will be delivered to topid on the specified channel ID (chid).
Currently the following flag is defined:
Users can specify what will be done if an action fails. By adding action fail actions to a list associated with an action, users can determine what will be done in the case of an action failure. For every action that fails, the corresponding action fail list will be executed. Certain actions (e.g. ham_action_log() and ham_action_heartbeat_healthy()) never fail. For more details, refer to the appropriate section in the HAM API reference for the ham_action_fail_*() calls.
A valid ham_action_t or NULL if an error occurred (errno is set).
The connection to the HAM is invalid. This happens when the process that opened the connection (using ham_connect()) and the process that's calling ham_action_notify_pulse() aren't the same.
In addition to the above errors, the HAM returns any error it encounters while servicing this request.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
ham_action_execute(), ham_action_notify_signal(), ham_action_remove(), ham_action_restart(), ham_action_waitfor(), ham_condition()