cmd

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 5 Imported by: 0

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 (gw *ProcessGroup) Context() context.Context

Context returns the context used by the ProcessGroup

func (*ProcessGroup) Go

func (gw *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) Wait

func (gw *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