event

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelBus

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

ChannelBus is an in-process pub/sub implementation for runtime events.

func NewChannelBus

func NewChannelBus() *ChannelBus

NewChannelBus constructs an in-process event bus backed by Go channels.

func (*ChannelBus) Close

func (b *ChannelBus) Close() error

Close shuts down the bus and closes all active subscriptions.

func (*ChannelBus) Publish

func (b *ChannelBus) Publish(ctx context.Context, event provider.Event) error

Publish fan-outs an event to subscribers of the event topic.

func (*ChannelBus) Subscribe

func (b *ChannelBus) Subscribe(ctx context.Context, topics ...provider.Topic) (<-chan provider.Event, error)

Subscribe registers a subscriber for one or more event topics.

type PGNotifyBus

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

func NewPGNotifyBus

func NewPGNotifyBus(dsn string, logger *slog.Logger) (*PGNotifyBus, error)

func (*PGNotifyBus) Close

func (b *PGNotifyBus) Close() error

func (*PGNotifyBus) Publish

func (b *PGNotifyBus) Publish(ctx context.Context, event provider.Event) error

func (*PGNotifyBus) Subscribe

func (b *PGNotifyBus) Subscribe(ctx context.Context, topics ...provider.Topic) (<-chan provider.Event, error)

Jump to

Keyboard shortcuts

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