parallel

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaitGroup

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

WaitGroup is an extension to sync.WaitGroup that provided channel for errors.

func NewWaitGroup

func NewWaitGroup() *WaitGroup

NewWaitGroup initializes new *WaitGroup and runs errors collection goroutine.

func (*WaitGroup) Add

func (wg *WaitGroup) Add(i int)

Add adds delta to WaitGroup counter.

func (*WaitGroup) Done

func (wg *WaitGroup) Done()

Done decrements WaitGroup counter by 1.

func (*WaitGroup) ErrChan

func (wg *WaitGroup) ErrChan() chan<- error

ErrChan returns channel for errors.

func (*WaitGroup) Wait

func (wg *WaitGroup) Wait() error

Wait waits for all goroutines to exit (via Done method) and returns multierror for all errors or nil.

func (*WaitGroup) WaitWithContext added in v0.20.0

func (wg *WaitGroup) WaitWithContext(ctx context.Context) error

WaitWithContext is the same Wait but respects context. If context is canceled waitgroups will not be waited and canceled error will be immediately returned.

Jump to

Keyboard shortcuts

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