Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContextShutdownHook ¶
func AddContextShutdownHook(f WithContextHookFunc)
AddContextShutdownHook associates a func that accepts a context.Context argument. The function will be called when a signal is caught allowing for cleanup.
Note: The context has a 5 second time limit for protection on shutdown. All shutdown hooks must be independent of each other since they are executed concurrently for faster shutdown.
func AddShutdownHook ¶
func AddShutdownHook(f WithoutContextHookFunc)
AddShutdownHook associates a no-arg func to be called when a signal is caught allowing for cleanup.
Note: the function should not block for a period of time and hold up the shutdown of this app/service. All shutdown hooks must be independent of each other since they are executed concurrently for faster shutdown.
func ListenForSignals ¶
func ListenForSignals()
ListenForSignals for a TERM or INT signal. Once the signal is caught all shutdown hooks will be executed allowing a graceful shutdown
Types ¶
type WithContextHookFunc ¶
type WithoutContextHookFunc ¶
type WithoutContextHookFunc func() error