workgroup

package
v0.0.0-...-c5ab296 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

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

Group manages a set of goroutines with related lifetimes.

func (*Group) Add

func (g *Group) Add(fn func(<-chan struct{}))

Add adds a function to the Group. Must be called before Run.

func (*Group) Run

func (g *Group) Run()

Run exectues each function registered with Add in its own goroutine. Run blocks until each function has returned. The first function to return will trigger the closure of the channel passed to each function, who should in turn, return.

Jump to

Keyboard shortcuts

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