streamregistry

package
v0.0.0-...-36d6306 Latest Latest
Warning

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

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

Documentation

Overview

Package streamregistry provides a centralized registry for routing mutation events to their appropriate event streams. It implements mutation.Publisher to enable automatic event publishing after successful transaction commits.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(evt mutation.Event)

Handler publishes a mutation event to the appropriate stream. Each handler has closure access to the concrete streamer it needs.

type Registry

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

Registry maps entity types to stream handlers. It implements mutation.Publisher for automatic publishing on commit.

func New

func New() *Registry

New creates an empty stream registry.

func (*Registry) PublishAll

func (r *Registry) PublishAll(events []mutation.Event)

PublishAll implements mutation.Publisher. Called automatically by mutation.Context.Commit() if configured.

func (*Registry) Register

func (r *Registry) Register(entity mutation.EntityType, handler Handler)

Register adds a handler for an entity type. Handlers should be registered at startup with closure access to streamers.

Jump to

Keyboard shortcuts

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