From 60cf6fc02fb0eafea7a6923fbfac858ae5250e58 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 10 Sep 2026 11:01:07 +0200 Subject: [PATCH] docs(provider): document the demo endpoint subprocess deliberate lifetime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Nicolas De Loof --- docs/examples/provider.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/examples/provider.go b/docs/examples/provider.go index 5ced2b20d..192e0c787 100644 --- a/docs/examples/provider.go +++ b/docs/examples/provider.go @@ -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))