broadcast

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 1 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast

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

Broadcast implements notifying waiters via a channel.

The zero-value of this struct is valid.

func (*Broadcast) Broadcast

func (c *Broadcast) Broadcast()

Broadcast closes the broadcast channel, triggering waiters.

func (*Broadcast) GetWaitCh

func (c *Broadcast) GetWaitCh() <-chan struct{}

GetWaitCh returns a channel that is closed when Broadcast is called.

func (*Broadcast) HoldLock added in v1.6.0

func (c *Broadcast) HoldLock(cb func(broadcast func(), getWaitCh func() <-chan struct{}))

HoldLock locks the mutex and calls the callback.

func (*Broadcast) HoldLockMaybeAsync added in v1.11.1

func (c *Broadcast) HoldLockMaybeAsync(cb func(broadcast func(), getWaitCh func() <-chan struct{}))

HoldLockMaybeAsync locks the mutex and calls the callback if possible. If the mutex cannot be locked right now, starts a new Goroutine to wait for it.

Jump to

Keyboard shortcuts

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