complexbroadcaster

package
v0.0.0-...-d55236c Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 0 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 {
	// private fields:
	Listenc chan chan (chan broadcast)
	Sendc   chan<- interface{}
}

func NewBroadcaster

func NewBroadcaster() Broadcaster

create a new broadcaster object.

func (Broadcaster) Broadcast

func (b Broadcaster) Broadcast(v interface{})

broadcast a value to all listeners.

func (Broadcaster) Listen

func (b Broadcaster) Listen() Receiver

start listening to the broadcasts.

type Receiver

type Receiver struct {
	// private fields:
	C chan broadcast
}

func (*Receiver) Read

func (r *Receiver) Read() interface{}

read a value that has been broadcast, waiting until one is available if necessary.

Jump to

Keyboard shortcuts

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