waitgroup

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wrapper

type Wrapper struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

Wrapper a wait group wrapper with counter

func (*Wrapper) Add

func (w *Wrapper) 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 (*Wrapper) Count

func (w *Wrapper) Count() int

Count returns current numbers of goroutines

func (*Wrapper) Done

func (w *Wrapper) Done()

Done decrements the WaitGroup counter by one.

func (*Wrapper) RecoverableWrap

func (w *Wrapper) RecoverableWrap(cb func())

RecoverableWrap recoverable wrap

func (*Wrapper) Wrap

func (w *Wrapper) Wrap(cb func())

Wrap wraps a callback, automatically adding and decreasing delta in the beginning and ending of callback execution respectively.

Jump to

Keyboard shortcuts

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