shutdown

package
v0.0.0-...-85a0a91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 7 Imported by: 0

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 WithContextHookFunc func(ctx context.Context) error

type WithoutContextHookFunc

type WithoutContextHookFunc func() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL