# `Snakepit.HeartbeatMonitor`
[🔗](https://github.com/nshkrdotcom/snakepit/blob/v0.13.0/lib/snakepit/heartbeat_monitor.ex#L1)

Monitors 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.

# `start_option`

```elixir
@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() -&gt; :ok | {:ok, term()} | {:error, term()} | term())}
  | {:dependent, boolean()}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `notify_pong`

```elixir
@spec notify_pong(pid(), integer()) :: :ok
```

Notify the monitor that a pong response has been received.

# `start_link`

```elixir
@spec start_link([start_option()]) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
