sync

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Waker

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

Waker is used to wake up a sleeper when some event occurs. It debounces multiple wakeup calls occurring between each sleep, and wakeups are non-blocking to avoid having to coordinate goroutines.

func NewWaker

func NewWaker() *Waker

NewWaker creates a new Waker.

func (*Waker) Sleep

func (w *Waker) Sleep() <-chan struct{}

Sleep returns a channel that blocks until Wake() is called.

func (*Waker) Wake

func (w *Waker) Wake()

Wake wakes up the sleeper.

Jump to

Keyboard shortcuts

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