lifecycle

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: AGPL-3.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LifecycleManager added in v0.21.0

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

LifecycleManager is a support struct for implementing module.ReadyDoneAware

func NewLifecycleManager added in v0.21.0

func NewLifecycleManager() *LifecycleManager

func (*LifecycleManager) OnStart added in v0.21.0

func (lm *LifecycleManager) OnStart(startupFns ...func())

OnStart will commence startup of the LifecycleManager. If OnStop has already been called before the first call to OnStart, startup will not be performed. After the first call, subsequent calls to OnStart do nothing.

func (*LifecycleManager) OnStop added in v0.21.0

func (lm *LifecycleManager) OnStop(shutdownFns ...func())

OnStop will commence shutdown of the LifecycleManager. If the LifecycleManager is still starting up, we will wait for startup to complete before shutting down. After the first call, subsequent calls to OnStop do nothing.

func (*LifecycleManager) ShutdownSignal added in v0.21.0

func (lm *LifecycleManager) ShutdownSignal() <-chan struct{}

ShutdownSignal returns a channel that is closed when shutdown has commenced.

func (*LifecycleManager) Started added in v0.21.0

func (lm *LifecycleManager) Started() <-chan struct{}

Started returns a channel that is closed when startup has completed. If the LifecycleManager is stopped before OnStart() is ever called, the returned channel will never be closed.

func (*LifecycleManager) Stopped added in v0.21.0

func (lm *LifecycleManager) Stopped() <-chan struct{}

Stopped returns a channel that is closed when shutdown has completed

Jump to

Keyboard shortcuts

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