sync

package
v0.0.0-...-1abf0d1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 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