GenServer that runs the mob.watch loop inside the mob.server process.
Polls lib/**/*.ex for changes every 500ms. When files change it
debounces, recompiles, and hot-pushes changed modules to all connected
device nodes via Erlang dist — same logic as mix mob.watch but driven
from the dashboard UI instead of a terminal.
Events broadcast to the "watch" PubSub topic:
{:watch_status, :watching | :idle}
{:watch_push, %{pushed: n, failed: [...], nodes: [...], files: [...]}}
Summary
Functions
Returns a specification to start this module under a supervisor.
Start watching. Idempotent — safe to call when already watching.
Returns %{watching: bool, nodes: [node()], last_push: map | nil}.
Stop watching.
Subscribe the calling process to watch PubSub events.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(term()) :: GenServer.on_start()
@spec start_watching() :: term()
Start watching. Idempotent — safe to call when already watching.
@spec status() :: map()
Returns %{watching: bool, nodes: [node()], last_push: map | nil}.
@spec stop_watching() :: term()
Stop watching.
@spec subscribe() :: :ok | {:error, term()}
Subscribe the calling process to watch PubSub events.