wait

package
v0.0.0-...-71a7f5d Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 6 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 (*Wait) Add

func (w *Wait) Add(delta int)

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

func (*Wait) AsyncDo

func (w *Wait) AsyncDo(f func())

AsyncDo async do

func (*Wait) Done

func (w *Wait) Done()

Done decrements the WaitGroup counter by one

func (*Wait) SyncDo

func (w *Wait) SyncDo(f func())

SyncDo sync do

func (*Wait) Try

func (w *Wait) Try(f func())

Try executes f, catching any panic it might spawn. It is safe to call from multiple goroutines simultaneously.

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