signal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupHandler

func SetupHandler[T any](logger *zap.Logger, callback Callback[T], callbackParam T) (context.Context, context.CancelFunc)

SetupHandler sets up a context which reacts to shutdownSignals

Types

type Callback

type Callback[T any] func(os.Signal, T) error

Callback is a callback that will be invoked when one of the shutdownSignals is caught. It is required that the implementation of this function should be very quick to ensure that it finishes in time before the subsequent signal is caught which will result in a forced exit of the app.

Jump to

Keyboard shortcuts

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