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
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
Click to show internal directories.
Click to hide internal directories.