sync

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-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 ErrorGroup

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

An ErrorGroup waits for a collection of goroutines that return errors to finish. The main goroutine calls Go one or more times to execute a function that returns an error in a goroutine. Then it calls Wait to wait for all goroutines to finish and collect the results of each.

func (*ErrorGroup) Go

func (eg *ErrorGroup) Go(action func() error)

Go runs the specified function in a goroutine.

func (*ErrorGroup) GoErrorSlice

func (eg *ErrorGroup) GoErrorSlice(action func() []error)

GoErrorSlice runs a function that returns a slice of errors in a goroutine.

func (*ErrorGroup) Wait

func (eg *ErrorGroup) Wait() []error

Wait waits for all functions run via Go to finish, and returns all of their errors.

Jump to

Keyboard shortcuts

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