pubsub

package
Version: v0.0.0-...-2c08a0f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

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

Broker is responsible to broadcast messages to the websocket pipes.

func New

func New() *Broker

New starts a new websocket message broadcaster.

func (*Broker) Broadcast

func (b *Broker) Broadcast(msg interface{})

Broadcast dispatches the messages to the websocket subscribers.

func (*Broker) Subscribe

func (b *Broker) Subscribe(f func(msg interface{})) (unsubscribe func())

Subscribe registers a websocket listener.

Source Files

Jump to

Keyboard shortcuts

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