change

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 7 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 change is the daemon's change log: a generation that every committed write and every in-memory input owner advances, with the topics and units each change touched. It lives in one process and is never persisted.

Index

Constants

View Source
const DefaultWindow = 4096

DefaultWindow is how many notes a Log keeps: about an hour of a busy daemon.

Variables

This section is empty.

Functions

func Poke

func Poke(c port.Changes, topics port.Topic) (poke <-chan struct{}, cancel func())

Poke adapts a subscription to a channel holding at most one pending poke, sent for every note whose topics meet the filter.

Types

type Log

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

Log is an in-memory, bounded change log. It satisfies port.Changes.

func NewLog

func NewLog(window int, logf func(format string, args ...any)) *Log

NewLog returns an empty log keeping the last window notes; logf reports a dropped subscriber and may be nil.

func (*Log) Epoch

func (l *Log) Epoch() string

func (*Log) Gen

func (l *Log) Gen() port.Generation

func (*Log) Note

func (l *Log) Note(t port.Topic, units ...unit.Unit) port.Change

Note records one committed change. No units is a unit-less change, not All.

func (*Log) NoteAll

func (l *Log) NoteAll(t port.Topic) port.Change

NoteAll records a change to every unit under t.

func (*Log) Since

func (l *Log) Since(from port.Generation, topics port.Topic) port.Change

Since merges the notes after from whose topics meet the filter. A from older than the window, or ahead of Gen, returns All with Topics = topics.

func (*Log) Subscribe

func (l *Log) Subscribe(fn func(port.Change)) (cancel func())

Jump to

Keyboard shortcuts

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