# `DalaDev.Server.WatchWorker`
[🔗](https://github.com/manhvu/dala_dev/blob/main/lib/dala_dev/server/watch_worker.ex#L1)

GenServer that runs the dala.watch loop inside the dala.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 dala.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: [...]}}

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(term()) :: GenServer.on_start()
```

# `start_watching`

```elixir
@spec start_watching() :: term()
```

Start watching. Idempotent — safe to call when already watching.

# `status`

```elixir
@spec status() :: map()
```

Returns %{watching: bool, nodes: [node()], last_push: map | nil}.

# `stop_watching`

```elixir
@spec stop_watching() :: term()
```

Stop watching.

# `subscribe`

```elixir
@spec subscribe() :: :ok | {:error, term()}
```

Subscribe the calling process to watch PubSub events.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
