broadcaster

package
v0.0.0-...-cca9b4c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2015 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcaster

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

Broadcaster emits signals to its listeners.

Signals cannot include information.

func New

func New() *Broadcaster

New creates a new broadcaster with no listeners.

func (*Broadcaster) Emit

func (b *Broadcaster) Emit()

Emit a signal and notify all listeners.

After emitting an event, all listeners will be removed.

func (*Broadcaster) Listen

func (b *Broadcaster) Listen() chan bool

Listen adds a listener to the broadcaster.

The returned channel will be activated for the next signal. After one signal the channel will be closed.

If the broadcaster is stopped before a next signal was emitted, the channel will be closed.

Jump to

Keyboard shortcuts

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