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 (*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.
Click to show internal directories.
Click to hide internal directories.