PhoenixAI.Store.HandlerGuardian (PhoenixAI.Store v0.1.0)

Copy Markdown View Source

Supervised GenServer that ensures the telemetry handler stays attached.

On init, attaches TelemetryHandler. Periodically checks that the handler is still registered with :telemetry and reattaches if missing.

Options

  • :name — GenServer name (required)
  • :handler_opts — options passed to TelemetryHandler.attach/1 (default: [])
  • :interval — check interval in ms (default: 30_000)

Usage

# As part of a supervision tree:
children = [
  {HandlerGuardian, name: :my_guardian, interval: 30_000}
]

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the HandlerGuardian GenServer.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the HandlerGuardian GenServer.