scheduler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

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

Scheduler polls the store for due scheduled jobs and runs them.

func NewScheduler

func NewScheduler(s store.Store, runner SubWorkflowRunner, logger *slog.Logger) *Scheduler

NewScheduler creates a new Scheduler.

func (*Scheduler) CalculateNextRun

func (s *Scheduler) CalculateNextRun(cronExpr string, from time.Time) (time.Time, error)

CalculateNextRun computes the next run time for a cron expression.

func (*Scheduler) RecoverMissed

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

RecoverMissed checks for jobs that missed their next_run_at and runs them once.

func (*Scheduler) Start

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

Start launches the background scheduling loop with a 60s ticker.

func (*Scheduler) Stop

func (s *Scheduler) Stop() error

Stop gracefully shuts down the scheduler.

type SubWorkflowRunner

type SubWorkflowRunner interface {
	RunFromTemplate(ctx context.Context, templateName, version string, params map[string]any, agentID string) error
}

SubWorkflowRunner is the interface the scheduler uses to run workflows. Satisfied by the executor (avoids import cycle).

Jump to

Keyboard shortcuts

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