scheduler

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package scheduler provides task scheduling services

Index

Constants

View Source
const (
	// TransformationTaskPrefix is the prefix for transformation scheduled tasks
	TransformationTaskPrefix = "transformation:"
	// ConsolidationTaskType is the task type for consolidation
	ConsolidationTaskType = "consolidation"
	// ExternalTaskPrefix is the prefix for external model tasks
	ExternalTaskPrefix = "external:"
	// QueueName is the queue name for scheduler tasks
	QueueName = "scheduler"
)

Variables

View Source
var (
	// ErrScheduleRegistrationFailed is returned when one or more scheduled tasks fail to register
	ErrScheduleRegistrationFailed = errors.New("failed to register scheduled tasks")
	// ErrInvalidExternalTaskType is returned when the external task type format is invalid
	ErrInvalidExternalTaskType = errors.New("invalid external task type format")
)
View Source
var (
	// ErrInvalidConcurrency is returned when concurrency is not positive
	ErrInvalidConcurrency = errors.New("concurrency must be positive")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Concurrency   int    `yaml:"concurrency" default:"10"`
	Consolidation string `yaml:"consolidation" default:"@every 10m"`
}

Config defines scheduler configuration

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the scheduler configuration is valid

type CoordinatorClient added in v0.0.2

type CoordinatorClient interface {
	Process(transformation models.Transformation, direction coordinator.Direction)
}

CoordinatorClient defines the minimal interface needed from coordinator

type Service

type Service interface {
	// Start initializes and starts the scheduler service
	Start(ctx context.Context) error

	// Stop gracefully shuts down the scheduler service
	Stop() error
}

Service defines the public interface for the scheduler

func NewService

func NewService(log logrus.FieldLogger, cfg *Config, redisOpt *redis.Options, dag models.DAGReader, coord coordinator.Service, adminService admin.Service) (Service, error)

NewService creates a new scheduler service

Jump to

Keyboard shortcuts

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