Documentation
¶
Overview ¶
Package cronfrontend schedules cron producers and their conversation Sync.
Index ¶
- func Stem(path string) string
- func ValidateRuntimeDefinitions(cfg *config.LockedConfig, runtimeDir string) error
- type Job
- type Manager
- func (m *Manager) Jobs() ([]Job, error)
- func (m *Manager) LoadOneOffCronjob(target string) (protocol.OneOffCronjob, error)
- func (m *Manager) Refresh() error
- func (m *Manager) RunOneOffCronjob(ctx context.Context, job *protocol.OneOffCronjob) (protocol.CronRunResult, error)
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop(ctx context.Context) error
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stem ¶ added in v0.2.20
Stem is the name the cron job at path is listed and loaded by: a cron file's stem, or "<agent> · <schedule>" for the routine at agents/<agent>.md#<schedule>.
func ValidateRuntimeDefinitions ¶
func ValidateRuntimeDefinitions(cfg *config.LockedConfig, runtimeDir string) error
ValidateRuntimeDefinitions loads cron definitions and routines from runtimeDir without mutating scheduler state.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager loads and runs workspace cron definitions.
func New ¶
func New(cfg *config.LockedConfig, runtimeDir string, store cronScheduleStore, run Runner, logger *slog.Logger) *Manager
New constructs a cronjob manager using runtimeDir for effective runtime cron definitions and agents' routines.
func (*Manager) Jobs ¶
Jobs returns loaded definitions and their next triggers in the next day. It neither refreshes scheduler state nor claims any work.
func (*Manager) LoadOneOffCronjob ¶
func (m *Manager) LoadOneOffCronjob(target string) (protocol.OneOffCronjob, error)
LoadOneOffCronjob resolves and loads one live cronjob, a cron file or a routine, for a run from Web.
func (*Manager) Refresh ¶ added in v0.2.21
Refresh loads the cron definitions anew; a reload calls it once it has validated and installed them. It syncs the schedules table before the scheduler uses them, and a load or sync error leaves both unchanged.
func (*Manager) RunOneOffCronjob ¶
func (m *Manager) RunOneOffCronjob(ctx context.Context, job *protocol.OneOffCronjob) (protocol.CronRunResult, error)
RunOneOffCronjob waits for a loaded producer and its required Sync.