Snakepit.HeartbeatMonitor (Snakepit v0.6.10)
View SourceMonitors a worker process using a configurable heartbeat protocol.
The monitor periodically invokes a ping function and expects the worker
to send a pong via notify_pong/2. Missed heartbeats trigger worker
termination, allowing supervisors to restart the worker.
Summary
Functions
Returns a specification to start this module under a supervisor.
Retrieve current monitor status.
Notify the monitor that a pong response has been received.
Types
@type start_option() :: {:worker_pid, pid()} | {:worker_id, String.t()} | {:ping_interval_ms, non_neg_integer()} | {:timeout_ms, non_neg_integer()} | {:max_missed_heartbeats, non_neg_integer()} | {:ping_fun, (integer() -> :ok | {:ok, term()} | {:error, term()} | term())} | {:dependent, boolean()}
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Retrieve current monitor status.
Notify the monitor that a pong response has been received.
@spec start_link([start_option()]) :: GenServer.on_start()