Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = errors.New("eventbus: closed")
ErrClosed is returned by Publish/Subscribe after Inmem.Close.
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)
// Close releases bus resources and closes all subscriber channels. Idempotent.
Close()
}
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 ¶
NewInmem returns an EventBus backed by in-memory channels. Logger may be nil (logging disabled).
func (*Inmem) Close ¶ added in v0.3.0
func (c *Inmem) Close()
Close closes all subscriber channels and rejects further Publish/Subscribe. Idempotent; safe if individual closeFns run afterward.
Click to show internal directories.
Click to hide internal directories.