Behaviours: gen_server.
hc_check_interval_opt() = {check_interval, timeout()}
hc_max_callback_fails_opt() = {max_callback_failures, non_neg_integer()}
hc_max_health_fails_opt() = {max_health_failures, non_neg_integer()}
health_opt() = hc_check_interval_opt() | hc_max_callback_fails_opt() | hc_max_health_fails_opt()
health_opts() = [health_opt()]
| check_health/1 | Force a health check for the given service. |
| code_change/3 | |
| handle_call/3 | |
| handle_cast/2 | |
| handle_info/2 | |
| init/1 | |
| node_down/0 | |
| node_up/0 | |
| nodes/1 | |
| resume_health_checks/0 | |
| service_down/1 | |
| service_down/2 | |
| service_up/2 | |
| service_up/3 | service_up/4 with default options. |
| service_up/4 | Create a service that can be declared up or down based on the result of a function in addition to usual monitoring. |
| services/0 | |
| services/1 | |
| start_link/0 | |
| suspend_health_checks/0 | |
| terminate/2 |
check_health(Service::atom()) -> ok
Force a health check for the given service. If the service does not have a health check associated with it, this is ignored. Resets the automatic health check timer if there is one.
See also: service_up/4.
code_change(OldVsn, State, Extra) -> any()
handle_call(X1, From, State) -> any()
handle_cast(X1, State) -> any()
handle_info(Msg, State) -> any()
init(X1) -> any()
node_down() -> any()
node_up() -> any()
nodes(Service) -> any()
resume_health_checks() -> any()
service_down(Id) -> any()
service_down(Id, X2) -> any()
service_up(Id, Pid) -> any()
service_up(Id::atom(), Pid::pid(), MFA::mfa()) -> ok
service_up/4 with default options.
See also: service_up/4.
service_up(Id::atom(), Pid::pid(), Callback::mfa(), Options::health_opts()) -> ok
Create a service that can be declared up or down based on the
result of a function in addition to usual monitoring. The function can
be set to be called automatically every interval, or only explicitly.
An explicit health check can be done using check_health/1. The
check interval is expressed in milliseconds. If infinity is passed
in, a check is never done automatically. The function used to check for
health must return a boolean; if it does not, it is considered an error.
A check has a default maximum health failures as 1, and maximum number
of other callback errors as 3. Either of those being reached will cause
the service to be marked as down. In the case of a health failure, the
health function will continue to be called at increasing intervals. In
the case of a callback error, the automatic health check is disabled.
The callback function will have the pid of the service prepended to its
list of args, so the actual arity of the function must be 1 + the length
of the argument list provided. A service added this way is removed like
any other, using service_down/1.
See also: service_up/2.
services() -> any()
services(Node) -> any()
start_link() -> any()
suspend_health_checks() -> any()
terminate(Reason, State) -> any()
Generated by EDoc