PhoenixAssets. DevServer
(PhoenixAssets v0.1.0)
View Source
Tracks supervised dev processes and buffers their output.
Provides runtime controls for the dev processes the DevSupervisor
runs: query liveness (status/1), restart or stop a process, and read a
recent slice of its output (logs/2). Each MuonTrap.Daemon is configured to
route its output here via log_line/2, where it is kept in a small per-process
ring buffer.
Summary
Functions
Returns a specification to start this module under a supervisor.
Appends an output line for dev process id. A no-op if the server is down.
Returns the most recent output lines for id (oldest first).
Monitors a daemon so [:phoenix_assets, :dev_server, :stop | :crash] is
emitted when it exits. A no-op if the tracker is down.
Restarts the dev process with the given id.
Starts the dev-process tracker.
Liveness of the dev process with the given id.
Stops the dev process with the given id.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Appends an output line for dev process id. A no-op if the server is down.
Returns the most recent output lines for id (oldest first).
Returns [] when the tracker is not running.
Monitors a daemon so [:phoenix_assets, :dev_server, :stop | :crash] is
emitted when it exits. A no-op if the tracker is down.
Restarts the dev process with the given id.
Returns {:error, :not_running} when the dev supervisor itself is down
(production, or dev mode disabled) -- this surface is called from Tidewave
and must degrade instead of crashing the caller.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the dev-process tracker.
@spec status(atom()) :: :running | :restarting | :down | :unknown
Liveness of the dev process with the given id.
Stops the dev process with the given id.
Returns {:error, :not_running} when the dev supervisor itself is down.