eventbus

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus interface {
	BusController
	BusSubscriber
	BusPublisher
}

func New

func New() Bus

type BusController

type BusController interface {
	HasCallback(topic string) bool
	WaitAsync()
}

type BusPublisher

type BusPublisher interface {
	Publish(topic string, args ...interface{})
}

type BusSubscriber

type BusSubscriber interface {
	Subscribe(topic string, fn interface{}) error
	SubscribeAsync(topic string, fn interface{}, transactional bool) error
	SubscribeOnce(topic string, fn interface{}) error
	SubscribeOnceAsync(topic string, fn interface{}) error
	Unsubscribe(topic string, handler interface{}) error
}

type EventBus

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

func (*EventBus) HasCallback

func (bus *EventBus) HasCallback(topic string) bool

func (*EventBus) Publish

func (bus *EventBus) Publish(topic string, args ...interface{})

func (*EventBus) Subscribe

func (bus *EventBus) Subscribe(topic string, fn interface{}) error

func (*EventBus) SubscribeAsync

func (bus *EventBus) SubscribeAsync(topic string, fn interface{}, transactional bool) error

func (*EventBus) SubscribeOnce

func (bus *EventBus) SubscribeOnce(topic string, fn interface{}) error

func (*EventBus) SubscribeOnceAsync

func (bus *EventBus) SubscribeOnceAsync(topic string, fn interface{}) error

func (*EventBus) Unsubscribe

func (bus *EventBus) Unsubscribe(topic string, handler interface{}) error

func (*EventBus) WaitAsync

func (bus *EventBus) WaitAsync()

Jump to

Keyboard shortcuts

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