bus

package
v0.48.4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

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

func New

func New() *Bus

func (*Bus) Close

func (b *Bus) Close()

func (*Bus) Len

func (b *Bus) Len() int

func (*Bus) Publish

func (b *Bus) Publish(event any) error

func (*Bus) Snapshot

func (b *Bus) Snapshot() []*Subscription

func (*Bus) Subscribe

func (b *Bus) Subscribe(name string, kind SubscriberKind, buf int) *Subscription

func (*Bus) Unsubscribe

func (b *Bus) Unsubscribe(sub *Subscription)

type SubscriberKind added in v0.48.1

type SubscriberKind int
const (
	SubscriberKindLoadBearing SubscriberKind = 0
	SubscriberKindObserver    SubscriberKind = 1
)

func AllSubscriberKind added in v0.48.3

func AllSubscriberKind() []SubscriberKind

func (SubscriberKind) String added in v0.48.1

func (e SubscriberKind) String() string

type Subscription

type Subscription struct {
	Name     string
	Observer bool
	Ch       chan any
	// contains filtered or unexported fields
}

func (*Subscription) Dropped

func (s *Subscription) Dropped() int64

Jump to

Keyboard shortcuts

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