wait

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wait

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

Wait is a wrapper of sync.WaitGroup which can wait with timeout.

func (*Wait) Add

func (w *Wait) Add(delta int)

NewWait returns a new Wait.

func (*Wait) Done

func (w *Wait) Done()

Done decrements the WaitGroup counter by one.

func (*Wait) Wait

func (w *Wait) Wait()

Wait waits until the WaitGroup counter is zero.

func (*Wait) WaitTimeout

func (w *Wait) WaitTimeout(timeout time.Duration) bool

WaitTimeout waits until the WaitGroup counter is zero or timeout. It returns true if timed out.

Jump to

Keyboard shortcuts

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