bus

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package bus is the in-process event bus: live notification only. Durability lives in the store; a dropped bus message is never data loss.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

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

func New

func New() *Bus

func (*Bus) Publish

func (b *Bus) Publish(ev core.Event)

Publish never blocks: a full subscriber's message is dropped.

func (*Bus) Subscribe

func (b *Bus) Subscribe(buffer int) (<-chan core.Event, func())

Subscribe returns a buffered channel and a cancel func. Cancel closes the channel and unregisters it; calling cancel twice is safe. An unbuffered subscriber would miss nearly every event under non-blocking publish, so buffers below 1 are raised to 1.

Jump to

Keyboard shortcuts

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