BeamConsoleWeb.Console.CollectorClient (beam_console v0.2.0)

Copy Markdown View Source

Provides an outage-safe boundary between the console LiveView and collector.

Every operation accepts the monitored collector PID explicitly and converts expected process exits into {:error, :unavailable}. This keeps transient supervisor restart windows out of LiveView callbacks.

Summary

Functions

Acknowledges a delivered sequence to an available collector process.

Returns the latest snapshot from an available collector process.

Requests an operator refresh from an available collector process.

Returns health information from an available collector process.

Subscribes the caller to an available collector process.

Types

server()

@type server() :: pid() | nil

unavailable()

@type unavailable() :: {:error, :unavailable}

Functions

acknowledge(server, sequence)

@spec acknowledge(server(), non_neg_integer()) :: :ok | unavailable()

Acknowledges a delivered sequence to an available collector process.

latest_snapshot(server)

@spec latest_snapshot(server()) ::
  {:ok, BeamConsole.Snapshot.t() | nil} | unavailable()

Returns the latest snapshot from an available collector process.

refresh(server)

@spec refresh(server()) :: :ok | {:error, :rate_limited | :unavailable}

Requests an operator refresh from an available collector process.

status(server)

@spec status(server()) :: {:ok, BeamConsole.Collector.Status.t()} | unavailable()

Returns health information from an available collector process.

subscribe(server)

@spec subscribe(server()) :: {:ok, BeamConsole.Snapshot.t() | nil} | unavailable()

Subscribes the caller to an available collector process.