chanotify

package
v0.0.0-...-5bc36da Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2016 License: Apache-2.0, CC-BY-SA-4.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 Notifier

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

Notifier can effectively notify you about receiving from particular channels. It operates with pairs <-chan struct{} <-> string which is notification channel and its identificator respectively. Notification channel is <-chan struc{}, each send to which is spawn notification from Notifier, close doesn't spawn anything and removes channel from Notifier.

func New

func New() *Notifier

New returns a new *Notifier.

func (*Notifier) Add

func (s *Notifier) Add(ch <-chan struct{}, id string)

Add adds new notification channel to Notifier.

func (*Notifier) Chan

func (s *Notifier) Chan() <-chan string

Chan returns channel on which client listen for notifications. IDs of notifications is sent to the returned channel.

func (*Notifier) Close

func (s *Notifier) Close()

Close closes the notifier and releases its underlying resources.

Jump to

Keyboard shortcuts

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