eventbus

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subscribe

func Subscribe[T any](b *EventBus, handler HandlerFunc[T]) string

Types

type EventBus

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

func NewEventBus

func NewEventBus(pool taskrunner.ThreadPool) *EventBus

func NewEventBusFromRunner

func NewEventBusFromRunner(runner *taskrunner.SequencedTaskRunner) *EventBus

func (*EventBus) Close

func (b *EventBus) Close()

func (*EventBus) Publish

func (b *EventBus) Publish(ctx context.Context, event any)

func (*EventBus) Unsubscribe

func (b *EventBus) Unsubscribe(id string)

func (*EventBus) WaitIdle

func (b *EventBus) WaitIdle(ctx context.Context) error

type HandlerFunc

type HandlerFunc[T any] func(ctx context.Context, event T)

Jump to

Keyboard shortcuts

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