From 278eeeba5b5c2c97926b3ebcee02b88edaf4ac08 Mon Sep 17 00:00:00 2001 From: Rene Nochebuena Guerrero Date: Fri, 7 Aug 2026 22:14:08 -0600 Subject: [PATCH] docs(worker): fix fictional launcher.Register/health.Register in doc examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The package-doc examples showed a fictional launcher.Register / health.Register API (and launcher.Append as a package func). Corrected to the real wiring: lc.Append + web/health.NewHandler(...).ServeHTTP. worker exposes lc.Append only — it is not observability.Checkable, so no health hook. Documentation-only. No code, API, or dependency changes; version stays v1.1.0 (the v1.1.0 tag is moved to include this fix). Verified by compiling the corrected pattern against the real API. --- README.md | 2 +- component.go | 2 +- doc.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f9cbc40..8145e0f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ import "code.nochebuena.dev/einherjar/worker" w := worker.New(logger, worker.DefaultConfig()) -launcher.Append(w) // OnInit starts pool; OnStop drains and stops +lc.Append(w) // OnInit starts pool; OnStop drains and stops ``` ### Dispatching tasks diff --git a/component.go b/component.go index 38722c8..ad05537 100644 --- a/component.go +++ b/component.go @@ -6,7 +6,7 @@ import ( ) // Component adds lifecycle management to Provider. -// Register with launcher.Register before starting. +// Append it to a launcher (lc.Append) before starting. type Component interface { lifecycle.Component observability.Identifiable diff --git a/doc.go b/doc.go index aaf12c0..a88af13 100644 --- a/doc.go +++ b/doc.go @@ -9,10 +9,10 @@ // ShutdownTimeout for all goroutines to finish. Returns nil regardless of // whether the drain completed before the deadline. // -// Register with the launcher before starting: +// Append to a launcher before starting: // // pool := worker.New(logger, cfg) -// launcher.Register(pool) +// lc.Append(pool) // // # Dispatching Tasks // -- 2.39.5