lifecycle

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lifecycle

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

Lifecycle formally manages various long-running goroutines for smooth cleanup when restarting major components (e.g. mediorum). This allows us to wait for all registered goroutines on a service to gracefully shut down before restarting the service.

func NewFromLifecycle

func NewFromLifecycle(lc *Lifecycle, name string) *Lifecycle

func NewLifecycle

func NewLifecycle(ctx context.Context, name string, z *zap.Logger) *Lifecycle

func (*Lifecycle) AddManagedRoutine

func (l *Lifecycle) AddManagedRoutine(name string, f func(context.Context) error)

func (*Lifecycle) ShutdownWithTimeout

func (l *Lifecycle) ShutdownWithTimeout(timeout time.Duration) error

func (*Lifecycle) Wait

func (l *Lifecycle) Wait()

Jump to

Keyboard shortcuts

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