Versions in this module Expand all Collapse all v1 v1.0.1 Apr 8, 2026 v1.0.0 Apr 8, 2026 Changes in this version + var ErrAlreadyStarted = errors.New("task already started") + var ErrCleanupFailed = errors.New("one or more cleanup functions failed") + var ErrCleanupTimeout = errors.New("cleanup timed out") + var ErrManagerStopped = errors.New("manager already stopped") + var ErrShutdownTimeout = errors.New("shutdown timed out waiting for tasks to stop") + type Action func(context.Context) error + type CleanupErrors []error + func (e CleanupErrors) LogValue() slog.Value + type Guard struct + func (g *Guard) TryStart() error + type Manager struct + func NewManager(opts ...Option) *Manager + func (tm *Manager) Cleanup(f func() error) + func (tm *Manager) Context() context.Context + func (tm *Manager) Run(tasks ...Task) error + func (tm *Manager) RunEphemeral(tasks ...Task) error + func (tm *Manager) Stop() error + func (tm *Manager) Wait() error + type Option func(options *options) + func WithCleanupTimeout(d time.Duration) Option + func WithContext(ctx context.Context) Option + func WithLogger(logger *slog.Logger) Option + func WithShutdownTimeout(d time.Duration) Option + type Task interface + Name func() string + Run func(context.Context) error