
lifecycle
Index
type Manager
Manager registers and supervises background services.
func NewManager
NewManager creates an empty service manager.
func (*Manager) Register
Register adds a named service. Services start in registration order and stop in reverse order.
func (*Manager) Run
Run starts all registered services and blocks until ctx is cancelled. Each service runs in its own goroutine with panic recovery and automatic restart.
func (*Manager) Stop
Stop calls Stop on services that implement Stoppable, in reverse registration order, bounded by the given timeout.
type Service
Service represents a long-running background task. Run blocks until ctx is cancelled or a fatal error occurs.
type Stoppable
Stoppable is an optional interface for services that need explicit cleanup beyond context cancellation.
Generated by gomarkdoc