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
- func Poke(c port.Changes, topics port.Topic) (poke <-chan struct{}, cancel func())
- type Log
- func (l *Log) Epoch() string
- func (l *Log) Gen() port.Generation
- func (l *Log) Note(t port.Topic, units ...unit.Unit) port.Change
- func (l *Log) NoteAll(t port.Topic) port.Change
- func (l *Log) Since(from port.Generation, topics port.Topic) port.Change
- func (l *Log) Subscribe(fn func(port.Change)) (cancel func())
Constants ¶
const DefaultWindow = 4096
DefaultWindow is how many notes a Log keeps: about an hour of a busy daemon.
Variables ¶
This section is empty.
Functions ¶
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 ¶
NewLog returns an empty log keeping the last window notes; logf reports a dropped subscriber and may be nil.
func (*Log) Gen ¶
func (l *Log) Gen() port.Generation