bus

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetPublisher

func SetPublisher(p Publisher)

SetPublisher 设置pub

func SetSubscriber

func SetSubscriber(s Subscriber)

SetSubscriber 设置sub

Types

type Publisher

type Publisher interface {
	// 发送事件
	Pub(*event.Event) error
	Connect() error
	Close() error
}

Publisher 发送事件

func P

func P() Publisher

P bus为全局对象

type Subscriber

type Subscriber interface {
	Sub() (<-chan *event.Event, error)
	Connect() error
	Close() error
}

Subscriber 订阅事件

func S

func S() Subscriber

S bus为全局对象

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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