internotify

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSource

func AddSource()

func GetQueue

func GetQueue() chan BaseEvent

func Push

func Push(e BaseEvent) error

* * Push *

func RemoveSource

func RemoveSource()

func StartInternalEventQueue

func StartInternalEventQueue()

* * 监控chan *

Types

type BaseEvent

type BaseEvent struct {
	Type  string
	Event string
	Ts    uint64
	Info  interface{}
}

func (BaseEvent) String

func (be BaseEvent) String() string

type InternalEventBus

type InternalEventBus struct {
	Queue       chan BaseEvent
	Rulex       typex.RuleX
	SourceCount uint
}

* * 内部事件总线 *

func InitInternalEventBus

func InitInternalEventBus(r typex.RuleX, MaxQueueSize int) *InternalEventBus

*

  • 内部事件,例如资源挂了或者设备离线、超时等等,该资源是单例模式, 维护一个channel来接收各种事件,将收到的消息吐到InterQueue即可

*

func (*InternalEventBus) GetSize

func (q *InternalEventBus) GetSize() int

Jump to

Keyboard shortcuts

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