graceful_shutdown

package
v0.0.0-...-416ecfb Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 3 Imported by: 9

README

Graceful Shutdown

This package provides a simple way to handle graceful shutdown signals in Go applications.

@startuml
participant "Main Function" as Main
participant "GracefulShutdown Function" as GS
participant "OS Signal" as OS

Main -> GS: Calls GracefulShutdown()
activate GS
GS -> OS: Listens for SIGINT, SIGQUIT, SIGTERM
OS --> GS: Sends signal
GS --> Main: Returns received signal and exits with code 143
deactivate GS
@enduml

Best Practices

143: Exit Code

The exit code 143 is used to indicate that the process was terminated by a signal. This is a common practice and is used by many applications.

References

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GracefulShutdown

func GracefulShutdown() os.Signal

Types

This section is empty.

Jump to

Keyboard shortcuts

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