schedule

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewJobs added in v0.22.1

func NewJobs(
	repoProvider *repos.Provider,
	globalProvider *globals.Provider,
) []sdsl.Job

NewJobs is the declarative job registry. Read it as a manifest: which providers contribute jobs.

Each provider owns its domain tasks, intervals, and DSL. Adding a new provider: one parameter + one line.

Pattern mirrors cmd.NewCommands — providers register themselves, registry assembles.

func NewResilienceClient added in v0.22.1

func NewResilienceClient() *resilience.Client

NewResilienceClient creates the application-wide resilience Client with OTEL plugin.

Types

type Plan added in v0.22.1

type Plan struct {
	Setup []sdsl.Job
	Work  []sdsl.Job
}

Plan holds jobs grouped by phase. Setup runs first, then Work. Scheduler knows the order — Plan is just data.

func NewPlan added in v0.22.1

func NewPlan(jobs []sdsl.Job) *Plan

NewPlan creates a Plan from jobs. Jobs are split by phase prefix in their name. Panics on duplicate job names.

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

Scheduler is the lifecycle engine. It knows its phases, their order, and their retry strategies. Scheduler owns this knowledge — it's not configurable, it's the core.

func NewScheduler

func NewScheduler(plan *Plan, client *resilience.Client, logger *slog.Logger) *Scheduler

NewScheduler creates a Scheduler.

func (*Scheduler) Run

func (s *Scheduler) Run(ctx context.Context) error

Run executes the lifecycle: setup first, then work.

Directories

Path Synopsis
Package globals is the global (non-partitioned) job provider for the scheduler.
Package globals is the global (non-partitioned) job provider for the scheduler.
Package repos is the repository-scoped job provider for the scheduler.
Package repos is the repository-scoped job provider for the scheduler.
Package sdsl provides the schedule DSL toolkit for job providers.
Package sdsl provides the schedule DSL toolkit for job providers.

Jump to

Keyboard shortcuts

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