supervisor

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Supervisor

type Supervisor struct {
	// contains filtered or unexported fields
}

Supervisor owns background goroutines and awaits them on Shutdown.

func New

func New(parent context.Context) *Supervisor

New creates a supervisor derived from parent.

func (*Supervisor) Closed

func (s *Supervisor) Closed() bool

Closed reports whether Shutdown has been called.

func (*Supervisor) Context

func (s *Supervisor) Context() context.Context

Context returns the supervisor context (canceled on Shutdown).

func (*Supervisor) Go

func (s *Supervisor) Go(fn func(ctx context.Context))

Go starts a goroutine tracked by the supervisor. fn should exit promptly when ctx is canceled.

func (*Supervisor) GoNamed

func (s *Supervisor) GoNamed(_ string, fn func(ctx context.Context))

GoNamed is like Go but panics are recovered (name for future diagnostics).

func (*Supervisor) Shutdown

func (s *Supervisor) Shutdown()

Shutdown cancels the context and waits for all goroutines.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL