Versions in this module Expand all Collapse all v1 v1.1.0 Sep 29, 2026 v1.0.0 May 21, 2026 Changes in this version + var ErrShutdownTimeout = errors.New("xshutdown: timeout waiting for tasks") + type Controller interface + Done func() <-chan struct{} + Run func() error + Stop func() error + Wait func(ch chan struct{}) error + WaitSignal func(ch chan os.Signal) error + type Manager struct + func New(parent context.Context, opts ...Option) *Manager + func (m *Manager) Context() context.Context + func (m *Manager) Derive() (context.Context, context.CancelFunc) + func (m *Manager) Done() <-chan struct{} + func (m *Manager) Go(fn func(ctx context.Context)) + func (m *Manager) Register(cancels ...context.CancelFunc) + func (m *Manager) RegisterFnErr(fns ...func(ctx context.Context) error) + func (m *Manager) Run() error + func (m *Manager) Stop() error + func (m *Manager) Wait(ch chan struct{}) error + func (m *Manager) WaitSignal(ch chan os.Signal) error + type Option func(*Manager) + func WithErrorHandler(fn func(error)) Option + func WithForceExit(code int) Option + func WithPreStopDelay(d time.Duration) Option + func WithSignals(sigs ...os.Signal) Option + func WithTimeout(d time.Duration) Option + type Registrar interface + Context func() context.Context + Derive func() (context.Context, context.CancelFunc) + Go func(fn func(ctx context.Context)) + Register func(cancels ...context.CancelFunc) + RegisterFnErr func(fns ...func(ctx context.Context) error) + type Shutdowner interface