Documentation
¶
Overview ¶
Package lifecycle manages explicit startup and reverse-order shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cleanup ¶
Cleanup adapts HTTP/gRPC servers, workers, telemetry providers, Kafka producers/consumers, SQL/Redis clients and log outputs. The resulting function is idempotent; a deadline can stop waiting without losing the ability to await ongoing cleanup again.
func NotifyContext ¶
NotifyContext explicitly opts into OS signal handling. The caller must invoke stop.
Types ¶
type Manager ¶
Manager serializes lifecycle operations. Hooks must respect their context.
func (*Manager) RegisterResource ¶
RegisterResource initializes an owned resource in startup order and closes it in reverse order. A factory that returns both a resource and an error has that partial resource cleaned up before the error is returned.