Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GracefulShutdownSystem ¶
func GracefulShutdownSystem( ctx context.Context, appLogger logger.Logger, errCh <-chan error, timeout time.Duration, shutdownTasks []ShutdownTask, ) <-chan struct{}
GracefulShutdownSystem waits for OS signal or error then runs provided shutdown tasks in the given order within the specified timeout. It returns a channel that's closed once all tasks complete or the timeout elapses.
Types ¶
type ShutdownOperation ¶
ShutdownOperation defines a function type for shutdown operations
type ShutdownTask ¶ added in v0.17.0
type ShutdownTask struct {
Name string
Op ShutdownOperation
}
ShutdownTask represents a task to be executed during graceful shutdown
Click to show internal directories.
Click to hide internal directories.