eventbus

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *simplifiedEventBus

New returns implementation of EventBus.

Types

type EventBus

type EventBus interface {
	Publisher
	Subscriber
}

EventBus allows subscribing and publishing data by topic

type Publisher

type Publisher interface {
	Publish(topic string, data interface{})
}

Publisher publishes events

type Subscriber

type Subscriber interface {
	Subscribe(topic string, fn interface{}) error
	SubscribeAsync(topic string, fn interface{}) error
	Unsubscribe(topic string, fn interface{}) error
	UnsubscribeWithUID(topic, uid string, fn interface{}) error
	SubscribeWithUID(topic, uid string, fn interface{}) error
}

Subscriber subscribes to events.

Jump to

Keyboard shortcuts

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