termination

package
v1.0.2545-ebf89fd Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package termination contains a simple handler for termination signals.

It is wired into system.System by default.

Index

Constants

This section is empty.

Variables

View Source
var ErrTerminated = o11y.NewWarning("terminated")

ErrTerminated is used to indicate that the Handle func received a shutdown signal.

Functions

func Handle

func Handle(ctx context.Context, delay time.Duration) error

Handle is intended to be used with a x/sync/errgroup.WithContext group. When a signal is received Handle returns ErrTerminated. If the context is cancelled Handle will return with no error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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