broadcaster

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignalBroadcaster

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

func NewSignalBroadcaster

func NewSignalBroadcaster() *SignalBroadcaster

func (*SignalBroadcaster) AddListener

func (b *SignalBroadcaster) AddListener(c chan<- struct{})

AddListener adds channel c to listeners, which will be written to once BroadcastNonblock is invoked.

func (*SignalBroadcaster) BroadcastNonblock

func (b *SignalBroadcaster) BroadcastNonblock()

BroadcastNonblock writes to all listeners in a non-blocking manner. BroadcastNonblock ignores unresponsive listeners.

func (*SignalBroadcaster) Len added in v0.3.5

func (b *SignalBroadcaster) Len() int

Len returns the number of listeners.

func (*SignalBroadcaster) RemoveListener

func (b *SignalBroadcaster) RemoveListener(c chan<- struct{})

RemoveListener removes channel c from the listeners.

Jump to

Keyboard shortcuts

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