local

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package local implements an in-process event bus using bounded channels. It is the default event bus and also serves as the per-node fan-out layer for cross-node implementations (Redis, PostgreSQL).

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
}

Bus is an in-process event bus with bounded subscriber channels.

func New

func New(bufferSize int) *Bus

New creates a local event bus with the given per-subscriber buffer size.

func (*Bus) Close

func (b *Bus) Close() error

Close shuts down the bus and closes all subscriber channels.

func (*Bus) Publish

func (b *Bus) Publish(_ context.Context, event registryeventbus.Event) error

Publish fans out an event to matching local subscribers. If a subscriber's buffer is full, its channel is closed (slow-consumer eviction).

func (*Bus) Subscribe

func (b *Bus) Subscribe(ctx context.Context, userID string) (<-chan registryeventbus.Event, error)

Subscribe returns a channel that receives matching events. Pass an empty userID to receive admin/all-events traffic only.

Jump to

Keyboard shortcuts

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