eventbus

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultEventBus

type DefaultEventBus struct {
	debuglog.NodeLogger
	ID int
	// contains filtered or unexported fields
}

func (*DefaultEventBus) Build

func (e *DefaultEventBus) Build()

Eventbus must be built before events are to be received. This is an commit from programmer, showing that all modules are inited and well-prepared to receive events.

func (*DefaultEventBus) InitDefault

func (e *DefaultEventBus) InitDefault()

func (*DefaultEventBus) ListenTo

func (e *DefaultEventBus) ListenTo(regInfo EventHandlerRegisterInfo)

func (*DefaultEventBus) Route

func (e *DefaultEventBus) Route(ev Event)

type Event

type Event interface {
	GetEventType() EventType
}

type EventBus

type EventBus interface {
	Route(Event)
}

type EventHandler

type EventHandler interface {
	HandlerDescription(EventType) string
	HandleEvent(Event)
	Name() string
}

type EventHandlerRegisterInfo

type EventHandlerRegisterInfo struct {
	Type    EventType
	Name    string
	Handler EventHandler
}

type EventType

type EventType uint8

Jump to

Keyboard shortcuts

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