KomachiHeartbeat v0.5.0 KomachiHeartbeat.Vital behaviour View Source

Behaviour which vital plugins implement.

defmodule ExampleVital do
  alias KomachiHeartbeat.Vital

  @behaviour Vital

  @impl Vital
  def init, do: nil

  @impl Vital
  def stats, do: {:ok, 42}

  @impl Vital
  def vital, do: :ok
end

Application.put_env(:komachi_heartbeat, :vitals, [ExampleVital])

Link to this section Summary

Callbacks

Initialize the vital.

Statistics. If it's not defined, use vital/0.

Vital.

Link to this section Types

Link to this section Callbacks

Initialize the vital.

Link to this callback

stats()

View Source
stats() :: :ok | :error | {:ok | :error, stats()}

Statistics. If it's not defined, use vital/0.

Link to this callback

vital()

View Source
vital() :: :ok | :error

Vital.