cmd

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcessGroup

type ProcessGroup struct {
	// contains filtered or unexported fields
}

ProcessGroup is an errgroup that listens for OS process signals

func NewProcessGroup

func NewProcessGroup(outerCtx context.Context) *ProcessGroup

NewProcessGroup creates a new ProcessGroup

func (*ProcessGroup) Context

func (pg *ProcessGroup) Context() context.Context

Context returns the context used by the ProcessGroup

func (*ProcessGroup) Go

func (pg *ProcessGroup) Go(f func() error)

Go calls the given function in a new goroutine.

The first call to return a non-nil error cancels the group; its error will be returned by Wait.

func (*ProcessGroup) Start added in v2.4.0

func (pg *ProcessGroup) Start(f func(context.Context) error)

Start calls the given function in a new goroutine and passes this group's context to it.

The first call to return a non-nil error cancels the group; its error will be returned by Wait.

func (*ProcessGroup) Wait

func (pg *ProcessGroup) Wait() error

Wait blocks until all function calls from the Go method have returned, then returns the first non-nil error (if any) from them.

Jump to

Keyboard shortcuts

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