Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewTasks ¶ added in v0.20.2
func NewTasks( repos *RepositoryTasks, repoValidator *repository.Validator, issuePoller *repository.IssuePoller, outboxRelay *repository.OutboxRelay, issueExplainer *global.IssueExplainer, ) []spec.Task
NewTasks is the declarative task registry. Read it as a manifest: what runs, under which partition.
Adding a per-repo task: one line in repos.Pack(...) Adding a global task: one line in global(...) Adding a partition: new XxxTasks type + new section here
func Preflight ¶
func Preflight(s repository.TaskSpec) repoTask
Preflight marks a repository TaskSpec as a preflight task. Preflights run before all other tasks. The partition may have incomplete data (e.g. Partition.RepositoryID may be zero).
Usage in registry:
repos.Pack(
schedule.Preflight(repoValidator.TaskSpec()),
issuePoller.TaskSpec(),
)
Types ¶
type Planner ¶
type Planner struct {
// contains filtered or unexported fields
}
Planner receives ready-to-schedule Tasks from the registry and splits them by Phase. It validates inputs (paranoid) but does not multiply or transform — that's done by providers.
func NewPlanner ¶
NewPlanner creates a Planner from Tasks provided by the registry. Panics on duplicate Task.Name — name is an operationally important identifier.
func (*Planner) Preflights ¶
Preflights returns tasks in PhasePreflight.
type RepositoryTasks ¶ added in v0.20.2
type RepositoryTasks struct {
// contains filtered or unexported fields
}
RepositoryTasks multiplies TaskSpecs by configured repositories. Each spec × each repo = one Task. Preflights get partition without repoID, work-phase tasks get partition with lazy-resolved repoID.
func NewRepositoryTasks ¶ added in v0.20.2
func NewRepositoryTasks(cfg *config.Github, store domain.RepositoryStore) *RepositoryTasks
NewRepositoryTasks creates a RepositoryTasks.
func (*RepositoryTasks) Pack ¶ added in v0.20.2
func (rt *RepositoryTasks) Pack(entries ...any) []spec.Task
Pack multiplies specs by configured repositories and returns ready-to-schedule Tasks.
Accepts repository.TaskSpec (default PhaseWork) or Preflight()-wrapped specs. Panics on zero Interval (must use spec.OneShot) or unknown entry type.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler orchestrates execution in two phases:
- Preflights — one-shot tasks, all must pass before workers start.
- Workers — long-running interval tasks.
Scheduler trusts Planner — it receives a flat list of Units and knows nothing about repositories, partitions, or scopes.
func NewScheduler ¶
NewScheduler creates a Scheduler.