event

package
v0.0.0-...-c98e9ca Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManager

func NewManager() interfaces.EventManager

NewManager creates a new event manager with a 100 event buffer

Types

type Manager

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

Manager handles and processes events

func (*Manager) Emit

func (e *Manager) Emit(eventName string, optionalData ...interface{})

Emit broadcasts the given event to the subscribed listeners

func (*Manager) On

func (e *Manager) On(eventName string, callback func(...interface{}))

On adds a listener for the given event

func (*Manager) OnMultiple

func (e *Manager) OnMultiple(eventName string, callback func(...interface{}), counter uint)

OnMultiple adds a listener for the given event that will trigger at most <counter> times.

func (*Manager) Once

func (e *Manager) Once(eventName string, callback func(...interface{}))

Once adds a listener for the given event that will auto remove after one callback

func (*Manager) PushEvent

func (e *Manager) PushEvent(eventData *messages.EventData)

PushEvent places the given event on to the event queue

func (*Manager) Shutdown

func (e *Manager) Shutdown()

Shutdown is called when exiting the Application

func (*Manager) Start

func (e *Manager) Start(renderer interfaces.Renderer)

Start the event manager's queue processing

Jump to

Keyboard shortcuts

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