eventbus

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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