runctx

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MPL-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultNotifySignals = []os.Signal{
	syscall.SIGINT,
	syscall.SIGTERM,
	syscall.SIGQUIT,
}

DefaultNotifySignals specifies signals that would cause the context to be canceled.

Functions

This section is empty.

Types

type Group added in v1.0.2

type Group struct {
	NotifySignals []os.Signal
	// contains filtered or unexported fields
}

Group is a collection of functions that would be run concurrently. The context passed to each function is canceled when any of the signals in NotifySignals is received.

func NewGroup added in v1.0.2

func NewGroup(fn ...func(ctx context.Context) error) *Group

func (*Group) Add added in v1.0.2

func (g *Group) Add(fn func(ctx context.Context) error)

func (*Group) Run added in v1.0.2

func (g *Group) Run() error

Run runs all the functions concurrently. See RunContext for more details.

func (*Group) RunContext added in v1.0.2

func (g *Group) RunContext(ctx context.Context) error

RunContext runs all the functions concurrently. It returns the first error returned by any of the functions. If the context is canceled, it returns nil.

Jump to

Keyboard shortcuts

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