interleave

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 0 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 interleave is the contract between the offline pipeline runner and the nodes it may order by time. A non-realtime graph with several such sources advances the one whose next packet is earliest, so a run's output is the same on every run. The contract stays inside the module: no other package can name Token, so none can opt in by accident.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gate

type Gate interface {
	Arm(tok Token, msg any) (int, bool)
	Admits(tok Token, arm int) bool
}

Gate is a converging stage (pipeline.Admitter) whose arm bound the time order can enforce at the turn instead of in Admit: Arm names the arm msg, the *pipeline.Message being delivered, is a frame of (false for messages the stage never holds back), and Admits reports, without blocking, whether the stage would take more of that arm now. An ordered run never calls Admit on a Gate; it passes over a source whose arm is held back, so which source runs next is decided by the order, never by the Go scheduler.

type Ordering

type Ordering struct {
	Realtime, Buffered                   bool
	Sources, TimedSources                int
	Converging, BlockingAdmitter, Merges bool
}

Ordering is the scheduling decision shared by the runtime and its planner. A plain blocking Admitter cannot participate: only Gate lets the scheduler inspect arm readiness without parking a delivery that holds the turn.

func (Ordering) Enabled

func (p Ordering) Enabled() bool

type Source

type Source interface {
	ByTime(Token) bool
}

Source is a graph source whose Start loop blocks only on Emit and on bounded input reads, and whose packets carry their times: a file demuxer pumping offline. ByTime reports whether this run of the source qualifies (a paced, realtime pump does not).

type Token

type Token struct{}

Token keeps Source and Gate unimplementable outside the module.

Jump to

Keyboard shortcuts

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