eventbus

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

eventbus

eventhub

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandler

func RegisterHandler(fn interface{})

Types

type Eventbus

type Eventbus interface {
	// contains filtered or unexported methods
}

func NewTypeEventBus

func NewTypeEventBus(hub *TypeEventHub) Eventbus

返回一个按类型注册的

type TypeEventHub

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

使用反射+入参类型实现的eventhub

func NewTypeEventHub

func NewTypeEventHub() *TypeEventHub

构造一个类型中枢

func (*TypeEventHub) GetHandlers

func (hub *TypeEventHub) GetHandlers(event interface{}) ([]*typeInvoker, bool)

获取处理函数

func (*TypeEventHub) RegisterHandler

func (hub *TypeEventHub) RegisterHandler(fn interface{})

注册一个监听

Jump to

Keyboard shortcuts

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