Documentation
¶
Overview ¶
Package timeline provides typed-event timeline replay: a sorted sequence of events at known offsets, advanced forward over an interval via a Cursor. Deterministic by construction — same input produces the same output emissions.
Domain-agnostic media-playback shape; common applications:
- Animation systems (notify-state replay, keyframe events).
- Video / audio editors (timeline-driven automation).
- Music sequencers (note-on / note-off scheduling).
- Scheduled-task playback / replay-driven simulations.
- Any system that needs to replay a sequence of timed events exactly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor[E any] struct { // contains filtered or unexported fields }
Cursor advances through a Timeline, emitting events whose offset falls within the most recently advanced span. The same shape as a media playback head — domain-agnostic.
func (*Cursor[E]) Advance ¶
Advance moves the cursor by `by` and invokes fn for every event in (oldOffset, newOffset]. Events at the same offset emit in insertion order (stable sort).
type Timeline ¶
type Timeline[E any] struct { // contains filtered or unexported fields }
Timeline is an immutable, sorted sequence of Events.