Documentation
¶
Overview ¶
Package lifecycle provides application lifecycle management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterShutdownListener ¶
func RegisterShutdownListener( shutdownlistener *internalhelper.ShutdownListener, lifecycle fx.Lifecycle, )
RegisterShutdownListener registers the shutdown listener in the lifecycle.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor is a struct that schedules and manages the execution of runners. It uses a WaitGroup to wait for all runners to finish before stopping.
type Runner ¶
type Runner interface {
// Name returns the name of the runner.
// It's only for debugging & logging purposes.
Name() string
// Run starts the runner with the given context.
Run(ctx context.Context) error
}
Runner is an interface that defines a runner that can be started with a context.
Click to show internal directories.
Click to hide internal directories.