graceful

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultTimeout is the default timeout for graceful shutdown.
	DefaultTimeout = 30 * time.Second
)

Functions

func Register

func Register(f gracefulShutdownFunc)

Register registers a function to be called when the server is shutdown.

func Shutdown

func Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server.

This function will block until the shutdown is complete. It is recommended to pass a context with timeout to limit the time of server shutdown.

Types

This section is empty.

Jump to

Keyboard shortcuts

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