Documentation
¶
Overview ¶
Package notify signals subscribers that something changed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Signals ¶
type Signals struct {
// contains filtered or unexported fields
}
Signals is a set of change channels. Each channel holds at most one pending signal, so a slow subscriber sees one wake-up for any number of changes and a notifier never blocks. The zero value is ready to use.
func (*Signals) Notify ¶
func (s *Signals) Notify()
Notify signals every subscriber that has no signal pending.
func (*Signals) Subscribe ¶
func (s *Signals) Subscribe() chan struct{}
Subscribe returns a channel signalled on every Notify.
func (*Signals) Unsubscribe ¶
func (s *Signals) Unsubscribe(ch chan struct{})
Unsubscribe stops signals to ch; a channel that is not subscribed is ignored.