graceful

package
v43.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnTerminationRequest

func OnTerminationRequest(f GracefulTerminationFunc) func()

Set up to call the given function (in a goroutine) when a termination request is received. Returns a function which, when called, will remove the callback. Only one callback can be installed at a time.

func Reset

func Reset()

Reset the package to its initial state (useful in tests)

func Terminate

func Terminate(finishTasks bool)

A graceful termination has been requested. Set a flag so that no further tasks are claimed, and interrupt any running task if `finishTasks` is true

func TerminationRequested

func TerminationRequested() bool

Return true if graceful termination has been requested

Types

type GracefulTerminationFunc

type GracefulTerminationFunc func(bool)

Jump to

Keyboard shortcuts

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