mux

package
v0.0.0-...-29f5a4c Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mux

type Mux struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Mux allows to multiplex streams to their subscribers

func New

func New() (*Mux, error)

New creates new Mux and returns it

func (*Mux) AddStream

func (m *Mux) AddStream(id string, size int) error

AddStream adds new stream to Mux with given id and size of its buffer

func (*Mux) AddSub

func (m *Mux) AddSub(id string, s sub.Subscriber) error

AddSub adds new subscriber to stream id

func (*Mux) Publish

func (m *Mux) Publish(msg *pb.Message) error

Publish sends the message down to dispatcher

func (*Mux) RemSub

func (m *Mux) RemSub(id string, s sub.Subscriber) error

RemSub removes subscriber from stream id

func (*Mux) RemoveStream

func (m *Mux) RemoveStream(id string) error

RemoveStream removes stream from Mux

func (*Mux) Stop

func (m *Mux) Stop() error

Stop stops all multiplexer dispatchers and waits for all goroutines to finish

Jump to

Keyboard shortcuts

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