emitter

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Async = iota
	Sync
	Cond
)

Variables

View Source
var (
	DefaultDispatcherFactory = dispatcher.BroadcastFactory
	DefaultAsyncEmitter      = New(dispatcher.ParallelBroadcastFactory)
	DefaultSyncEmitter       = New(dispatcher.BroadcastFactory)
	DefaultCondEmitter       = New(dispatcher.ConditionalParallelBroadcastFactory)
)

Functions

This section is empty.

Types

type Emitter

type Emitter struct {
	sync.Mutex
	DispatcherFactory events.DispatcherFactory
	Dispatchers       map[string]events.Dispatcher
}

func New

func New(factory ...events.DispatcherFactory) *Emitter

func NewWithType

func NewWithType(typ int) *Emitter

func (Emitter) Events

func (emitter Emitter) Events() map[string]events.Dispatcher

func (Emitter) Fire

func (emitter Emitter) Fire(e interface{}, mode int, context ...param.Store) error

func (Emitter) HasEvent

func (emitter Emitter) HasEvent(event string) bool

func (Emitter) Off

func (emitter Emitter) Off(event string) events.Emitter

func (Emitter) On

func (emitter Emitter) On(event string, handlers ...events.Listener) events.Emitter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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