PhoenixReplay.Capture.Handlers (PhoenixReplay v0.6.2)

Copy Markdown View Source

Owns the telemetry and :logger handlers that record sessions.

Handlers are global and outlive the process that attaches them, so this process ties their lifetime to the supervision tree: it attaches PhoenixReplay.Capture.ViewEvents, PhoenixReplay.Capture.LiveComponents, the configured PhoenixReplay.Capture.TelemetryEvents and PhoenixReplay.Capture.Logs when it starts, and detaches them when it stops. It traps exits so it detaches them on shutdown, and detaches leftovers before attaching, so a restart after it was killed attaches each handler once.

The handlers run in the processes that emit events, not in this one, so recording never waits on it.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the handler owner registered under its module name.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(config)

@spec start_link(PhoenixReplay.Config.t()) :: GenServer.on_start()

Starts the handler owner registered under its module name.