Help us shape the future of Go! Take the 2026 Go Developer Survey

event

package
v1.16.9 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 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 added in v1.12.0

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 added in v1.12.0

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 added in v0.18.4

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