shutdown

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wait

func Wait(ctx context.Context, cancel context.CancelFunc, termFn TerminationFn) error

Wait allows the service to wait for a termination signal, start the cancellation process by calling the context.CancelFunc in order to perform a graceful service shutdown executing the TerminationFn in input.

func WaitWithLogger added in v0.1.0

func WaitWithLogger(ctx context.Context, cancel context.CancelFunc, termFn TerminationFn, logger logger.Logger) error

WaitWithLogger is similar to Wait but it logs on status updates.

Types

type TerminationFn

type TerminationFn func(context.Context) error

TerminationFn is a callback invoked on context cancellation.

Jump to

Keyboard shortcuts

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