eventbus

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParam = errors.New("没有传递必要的参数")
)

Functions

func DestroyEventBus

func DestroyEventBus()

func InitEventBus added in v0.1.4

func InitEventBus(startBlockEventCount uint, dealEventRoutingCount uint8)

Types

type Event added in v0.1.4

type Event struct {
	PublishTypeName string
	PublishEvent    interface{}
}

type EventBus

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

func GetBus added in v0.1.4

func GetBus() *EventBus

func (*EventBus) Publish

func (bus *EventBus) Publish(events ...interface{})

func (*EventBus) RegisterAllExistEvents added in v0.1.4

func (bus *EventBus) RegisterAllExistEvents(subscriber Subscriber) error

func (*EventBus) RegisterSubscriber

func (bus *EventBus) RegisterSubscriber(subscriber Subscriber, events ...interface{}) error

func (*EventBus) UnRegisterAllEvents added in v0.1.4

func (bus *EventBus) UnRegisterAllEvents(subscriber Subscriber) error

func (*EventBus) UnRegisterSubscriber

func (bus *EventBus) UnRegisterSubscriber(subscriber Subscriber, events ...interface{}) error

type Subscriber

type Subscriber interface {
	OnEvent(event *Event)
}

Jump to

Keyboard shortcuts

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