eventbus

package
v0.1.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

type EventBus interface {
	Publish(ctx context.Context, channel string, data []byte) error
	// Subscribe returns a receive-only channel of payloads and a close function. The caller must call close when done.
	Subscribe(ctx context.Context, channel string) (data <-chan []byte, closeFn func() error, err error)
}

EventBus is pub/sub for agent events (streaming, approval fan-in). SDK runtimes use this internally; application code does not construct EventBus. Implementations may be in-memory, Redis-backed, or bridged from Temporal updates.

type Inmem

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

Inmem is a process-local pub/sub suitable for streaming and approval fan-in on one host.

func NewInmem

func NewInmem(l logger.Logger) *Inmem

NewInmem returns an EventBus backed by in-memory channels. Logger may be nil (logging disabled).

func (*Inmem) Publish

func (c *Inmem) Publish(ctx context.Context, channel string, data []byte) error

Publish sends a copy of data to all subscribers of channel.

func (*Inmem) Subscribe

func (c *Inmem) Subscribe(ctx context.Context, channel string) (<-chan []byte, func() error, error)

Subscribe registers a new subscriber for channel.

Jump to

Keyboard shortcuts

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