docs(provider): document the demo endpoint subprocess deliberate lifetime

The serve-demo subprocess is the demo's provisioned resource: it must
outlive the provider invocation — consumers reach it through the relay
after up returns — and it reaps itself after three minutes. Spell that
out where a reader (or reviewer) would otherwise expect a Kill/Wait.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Nicolas De Loof <[email protected]>
This commit is contained in:
Nicolas De Loof
2026-09-16 17:03:23 +02:00
committed by Nicolas De loof
co-authored by Claude Fable 5
parent 39193657eb
commit 60cf6fc02f
+7
View File
@@ -188,6 +188,13 @@ func up(options options, args []string) {
fmt.Printf(`{ "type": "error", "message": "demo endpoint did not come up: %v" }%s`, err, lineSeparator)
return
}
// The subprocess deliberately outlives this invocation — it IS the
// provisioned resource the relay forwards to, and consumers connect
// through it only after up has returned, so reaping it here would
// tear the endpoint down before anyone reached it. Its lifetime is
// its own: it exits by itself after three minutes (serve-demo), the
// way a real provider's resource outlives the provider CLI run.
//
// the endpoint is announced as seen from THIS process's host —
// the relay translates loopback into the container-visible name
_, port, _ := net.SplitHostPort(strings.TrimSpace(addr))