shutdown

package
v0.0.0-...-48c6f6e Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupGracefully

func SetupGracefully(ctx context.Context, starter Starter) error

SetupGracefully it's a helper to run the Starter that was been passed by parameters and ensure they will be stoped gracefully.

Types

type Starter

type Starter interface {
	Run(ctx context.Context) error     // Run starts the component and processes in the background.
	Cleanup(ctx context.Context) error // Cleanup shuts down the component gracefully.
}

Starter interface defines the methods required for a component to be started and cleaned up gracefully.

Jump to

Keyboard shortcuts

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