util

package
v0.0.0-...-3b2d471 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GracefulShutdown

func GracefulShutdown(wg *sync.WaitGroup, cancel context.CancelFunc)

GracefulShutdown supports to clean up goroutines after termination signal captured.

func StartAndGracefulShutdown

func StartAndGracefulShutdown(run func(ctx context.Context, wg *sync.WaitGroup))

StartAndGracefulShutdown starts to run the specified task in a goroutine and wait for termination signal to shutdown gracefully.

Note, this method is not suitable for any non-blocking task that release resources in defer way.

Types

This section is empty.

Jump to

Keyboard shortcuts

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