Documentation ¶
Overview ¶
Package graceful provides an orchestrator for graceful shutdown.
Index ¶
Constants ¶
View Source
const DefaultTimeout = 10 * time.Second
DefaultTimeout is a default Timeout to wait for graceful termination.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Shutdown ¶
Shutdown manages graceful shutdown.
func (*Shutdown) EnableGracefulShutdown ¶
func (s *Shutdown) EnableGracefulShutdown()
EnableGracefulShutdown schedules service locator termination SIGTERM or SIGINT.
func (*Shutdown) ShutdownSignal ¶
func (s *Shutdown) ShutdownSignal(subscriber string) (shutdown <-chan struct{}, done chan<- struct{})
ShutdownSignal returns a channel that is closed when service locator is closed or os shutdownSignal is received and a confirmation channel that should be closed once subscriber has finished the shutdown.
Click to show internal directories.
Click to hide internal directories.