# `Gralkor.Server`
[🔗](https://github.com/elimydlarz/gralkor/blob/main/lib/gralkor/server.ex#L1)

Supervises a single Python uvicorn process via Port.

- init/1 never blocks; handle_continue(:boot) runs the slow work.
- Boot sequence: write config.yaml → Port.open(uv run uvicorn) → health-poll
  at 500ms until 200 or 120s timeout → schedule 60s monitor.
- Health monitor stops the GenServer on failure; supervisor restarts.
- Graceful shutdown: SIGTERM the OS pid, wait up to 30s for {:exit_status, _},
  then SIGKILL.

# `state`

```elixir
@type state() :: %{
  config: Gralkor.Config.t(),
  port: port() | nil,
  os_pid: non_neg_integer() | nil,
  opts: keyword()
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

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

---

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