wait

package
v0.0.0-...-6438891 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT 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 similar with sync.WaitGroup which can wait with timeout

func NewWait

func NewWait() *Wait

func (*Wait) Add

func (w *Wait) Add(delta int)

Add adds delta, which may be negative, to the WaitGroup counter.

func (*Wait) Done

func (w *Wait) Done()

Done decrements the WaitGroup counter by one

func (*Wait) Wait

func (w *Wait) Wait()

Wait blocks until the WaitGroup counter is zero.

func (*Wait) WaitWithTimeout

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

WaitWithTimeout blocks until the WaitGroup counter is zero or timeout returns true if timeout

Jump to

Keyboard shortcuts

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