scheduler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package scheduler builds and runs the task dependency DAG. It memoizes each (namespace, task, canonical-args) so a node runs at most once per invocation (FR-005), runs dependencies before the body and post-hooks after, detects cycles, and fails fast on the first error. [parallel] dependencies run concurrently (bounded by CPU count) while preserving run-once semantics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(engine Engine, roots []Invocation) error

Run executes the given root invocations in order, sharing one memo table so repeated tasks run once across the whole invocation.

Types

type CycleError

type CycleError struct {
	Path []string
}

CycleError reports a dependency cycle with the offending path.

func (*CycleError) Error

func (e *CycleError) Error() string

type Engine

type Engine interface {
	// ResolveDep evaluates a dependency/post-hook call in the scope of the
	// calling task, returning the target task and its bound parameters.
	ResolveDep(curTask *ast.Task, curParams map[string]string, dep *ast.DepCall) (*ast.Task, map[string]string, error)
	// Execute runs a single task body with its bound parameters.
	Execute(task *ast.Task, params map[string]string) error
	// Namespace returns the memoization namespace for a task (mod path, or "").
	Namespace(task *ast.Task) string
}

Engine resolves dependencies and executes task bodies. The CLI layer implements it (it owns the evaluator, parameter binding, and executors).

type Invocation

type Invocation struct {
	Task   *ast.Task
	Params map[string]string
}

Invocation is a task plus its resolved parameters (a scheduler root).

Jump to

Keyboard shortcuts

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