syncs

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaitGroup

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

WaitGroup is simalar to sync.WaitGroup but mixin a channel to limit parallelism

func (*WaitGroup) Add

func (wg *WaitGroup) Add()

Add will firstly apply channel send and then call underlying WaitGroup.Add(1) it blocks if too many goroutine call Add

func (*WaitGroup) Done

func (wg *WaitGroup) Done()

Done will firstly apply channel receive and then call underlying WaitGroup.Done() it allow some goroutine unblock

func (*WaitGroup) Wait

func (wg *WaitGroup) Wait()

Jump to

Keyboard shortcuts

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