events

package
v2.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventsHandler

func NewEventsHandler() events.Handler

Types

type EventHandler

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

EventHandler helps to broadcast events to multiple listeners.

func (*EventHandler) AddListener

func (eb *EventHandler) AddListener(listener events.EventListener)

AddListener registers new event listener.

func (*EventHandler) NumListeners

func (eb *EventHandler) NumListeners() int

NumListeners returns number of event listeners.

func (*EventHandler) Push

func (eb *EventHandler) Push(e interface{})

Push broadcast events across all event listeners.

Jump to

Keyboard shortcuts

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