mux

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Callback     func()
	ErrorCounter *uint64
	Logger       *common.Logger
	// contains filtered or unexported fields
}

Config is a Mux config

type Mux

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

Mux is an event dispatcher with buffer

func New

func New(ctx context.Context, v *viper.Viper, c Config) (*Mux, error)

New creates a Mux with config

func (*Mux) BufferSize

func (m *Mux) BufferSize() int

BufferSize returns the size of the buffer

func (*Mux) Close

func (m *Mux) Close()

Close the mux

func (*Mux) Push

func (m *Mux) Push(ev event.Event, f func())

Push the event into queue

func (*Mux) Start

func (m *Mux) Start()

Start a Mux

func (*Mux) Subscribe

func (m *Mux) Subscribe(s muxSink)

Subscribe adds a sink to the Mux

func (*Mux) TryFlushQueue

func (m *Mux) TryFlushQueue()

TryFlushQueue flush the queue if there's something in it

Jump to

Keyboard shortcuts

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