pubsub

package
v0.0.0-...-b952f1b Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventBus

func NewEventBus()

Types

type Event

type Event struct {
	Topic string
	Val   interface{}
}

type EventBus

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

func (*EventBus) AsyncPublish

func (e *EventBus) AsyncPublish(event *Event)

func (*EventBus) Publish

func (e *EventBus) Publish(event *Event)

func (*EventBus) Subscribe

func (e *EventBus) Subscribe(topic string, o ObServer)

func (*EventBus) UnSubscribe

func (e *EventBus) UnSubscribe(topic string, o ObServer)

type IEventBus

type IEventBus interface {
	Subscribe(topic string, server ObServer)
	UnSubscribe(topic string, server ObServer)
	Publish(event *Event)
	AsyncPublish(event *Event)
}

type ObServer

type ObServer interface {
	OnChange(e *Event)
}

Jump to

Keyboard shortcuts

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