event_bus

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KernelEventApplicationLaunched    = "kernelEvent.ApplicationLaunched"
	KernelEventApplicationTermination = "kernelEvent.ApplicationTermination"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

type EventBus map[reflect.Type]listenersChain

func NewEventBus

func NewEventBus() EventBus

func (EventBus) AppendListener

func (b EventBus) AppendListener(eventObj event.Event, listenerFunc interface{}, priority int) error

eventObj - should be a pointer to the Event object listenerFunc - should be a function with one argument, that argument should be a pointer to the Event object priority - priority of this listener in listeners chain

func (EventBus) Dispatch

func (b EventBus) Dispatch(eventObj event.Event)

type EventsRegistry

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

func NewRegistry

func NewRegistry() *EventsRegistry

func (*EventsRegistry) GetEventByName

func (r *EventsRegistry) GetEventByName(name string) (event.Event, error)

func (*EventsRegistry) Register

func (r *EventsRegistry) Register(name string, eventObj event.Event)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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