scheduler

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package scheduler provides deterministic routing helpers for task dispatch.

Package scheduler provides deterministic routing helpers for task dispatch.

Package scheduler provides deterministic routing helpers for task dispatch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRoleCaps

func ApplyRoleCaps(ordered []index.Task, caps RoleCaps) []index.Task

ApplyRoleCaps selects tasks in order, enforcing global and per-role caps.

func OrderedEligibleTasks

func OrderedEligibleTasks(idx index.Index, inFlight map[string]struct{}) ([]index.Task, error)

OrderedEligibleTasks returns eligible tasks ordered deterministically by state, plan order, and id.

Types

type RoleCaps

type RoleCaps struct {
	Global      int
	DefaultRole int
	Roles       map[index.Role]int
}

RoleCaps captures the global, default-role, and per-role concurrency limits.

func RoleCapsFromConfig

func RoleCapsFromConfig(cfg config.Config) RoleCaps

RoleCapsFromConfig builds role caps from the supplied config, applying defaults as needed.

type RoutingDecision

type RoutingDecision struct {
	Task     index.Task
	Selected bool
	Reason   string
}

RoutingDecision captures the selection outcome for a task and the reason.

type RoutingResult

type RoutingResult struct {
	Decisions []RoutingDecision
	Selected  []index.Task
}

RoutingResult summarizes routing decisions and selected tasks.

func RouteEligibleTasks

func RouteEligibleTasks(idx index.Index, caps RoleCaps, inFlight map[string]struct{}) (RoutingResult, error)

RouteEligibleTasks orders eligible tasks and applies caps to select tasks with reasons.

func RouteOrderedTasks

func RouteOrderedTasks(ordered []index.Task, caps RoleCaps) RoutingResult

RouteOrderedTasks applies caps to ordered tasks and returns routing decisions.

Jump to

Keyboard shortcuts

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