Documentation
¶
Overview ¶
Package helper provides utility functions for graceful shutdown management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShutdownListener ¶ added in v0.1.22
type ShutdownListener struct {
Shutdowners []Shutdowner
}
ShutdownListener manages multiple shutdowner instances and coordinates their shutdown.
func NewShutdownListener ¶ added in v0.1.22
func NewShutdownListener() *ShutdownListener
NewShutdownListener creates a new ShutdownListener instance.
func (*ShutdownListener) Register ¶ added in v0.1.22
func (s *ShutdownListener) Register(shutdowner Shutdowner)
Register adds a shutdowner to the list of components to be shut down.
func (*ShutdownListener) RegisterFunc ¶ added in v0.1.22
func (s *ShutdownListener) RegisterFunc(shutdownFunc func(ctx context.Context) error)
RegisterFunc adds a shutdown function to the list of components to be shut down.
type Shutdowner ¶ added in v0.1.22
Shutdowner is an interface for components that need to be shut down gracefully.
Click to show internal directories.
Click to hide internal directories.