observationbridge

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0 Imports: 3 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

Overview

Package observationbridge owns CLI-side execution of bounded producer observation streams. Producers retain only queue and completion authority; projection, cancellation, and join accounting stay at the command boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicationGate

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

PublicationGate linearizes reader cancellation with command publication. Projection may already be active when Revoke returns, but it cannot acquire publication authority afterward.

func (*PublicationGate) Commit

func (gate *PublicationGate) Commit(ctx context.Context, publish func() bool) bool

func (*PublicationGate) Revoke

func (gate *PublicationGate) Revoke()

type Reader

type Reader[T any] struct {
	// contains filtered or unexported fields
}

Reader owns exactly one goroutine for one enabled stream. The producer can fill its bounded early prefix before Start because receiving begins only here.

func Start

func Start[T any](stream <-chan T, gate *PublicationGate, project func(context.Context, T)) *Reader[T]

func (*Reader[T]) Join

func (reader *Reader[T]) Join(ctx context.Context) Status

Join waits only within ctx, then revokes future publication and cancels the reader. It never performs an unconditional second wait for a blocked projector.

type Status

type Status struct {
	Forwarded uint64
	Buffered  uint64
	Active    bool
	Joined    bool
}

Status describes only facts knowable at the reader join cut. Joined=false deliberately does not imply that cancellation terminated an active projector.

Jump to

Keyboard shortcuts

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