bus

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Publish

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

func Subscribe

func Subscribe(topic string, fn interface{}) string

func SubscribeOnce

func SubscribeOnce(topic string, fn interface{}) string

func SubscribeWithBlock

func SubscribeWithBlock(topic string, fn interface{}) string

func Unsubscribe

func Unsubscribe(lid string)

Types

type Bus added in v1.1.0

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

func (*Bus) Publish added in v1.1.0

func (b *Bus) Publish(topic string, args ...interface{})

func (*Bus) Subscribe added in v1.1.0

func (b *Bus) Subscribe(l *Listener)

func (*Bus) Unsubscribe added in v1.1.0

func (b *Bus) Unsubscribe(lid string)

type Listener added in v1.1.0

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

func NewListener added in v1.1.0

func NewListener(topic string, fn interface{}, block, once bool) *Listener

Jump to

Keyboard shortcuts

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