utilccl

package
v0.0.0-...-b3f1699 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaitGroupWithError

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

WaitGroupWithError is a sync.WaitGroup that also tracks the errors that are generated in associated asynchronous work.

Example usage: var wg WaitGroupWithError

for _ := range bar {
  wg.Add(1)
  go func() {
    wg.Done(maybeError())
  }
}

wg.Wait() return wg.FirstError()

func (*WaitGroupWithError) Add

func (wg *WaitGroupWithError) Add(delta int)

Add adds delta, which may be negative, to the WaitGroup counter. If the counter becomes zero, all goroutines blocked on Wait are released. If the counter goes negative, Add panics.

func (*WaitGroupWithError) Done

func (wg *WaitGroupWithError) Done(err error)

Done decrements the WaitGroup counter and records the error if non-nil.

func (*WaitGroupWithError) FirstError

func (wg *WaitGroupWithError) FirstError() error

FirstError returns the first error that was passed to Done (wrapped in a count of how many total errors there were) or nil if there were no errors.

func (*WaitGroupWithError) Wait

func (wg *WaitGroupWithError) Wait()

Wait blocks until the WaitGroup counter is zero.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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