topic

package
v0.0.0-...-9d8b9bc Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: GPL-3.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 Receiver

type Receiver chan interface{}

Receiver is able to receive broadcast messages

type Topic

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

Topic is for broadcasting

func New

func New() *Topic

New makes a Topic

func (*Topic) Close

func (t *Topic) Close()

Close closes all associated channels in and out

func (*Topic) Out

func (t *Topic) Out() chan<- interface{}

Out gives access to the broadcast channel

func (*Topic) Send

func (t *Topic) Send(m interface{})

Send broadcasts to all receivers

func (*Topic) Sub

func (t *Topic) Sub(ctx context.Context, rx Receiver) error

Sub subscribes a receiver

Jump to

Keyboard shortcuts

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