Documentation ¶
Index ¶
- Constants
- Variables
- func MachineCollection(tree *hsm.Node) hsm.Collection[Scheduler]
- func RegisterExecutor(registry *hsm.Registry, executorOptions TaskExecutorOptions, config *Config) error
- func RegisterStateMachine(r *hsm.Registry) error
- func RegisterTaskSerializers(reg *hsm.Registry) error
- type Config
- type EventSchedulerActivate
- type ScheduleTask
- type ScheduleTaskSerializer
- type Scheduler
- type TaskExecutorOptions
Constants ¶
View Source
const StateMachineType = "scheduler.Scheduler"
Unique type identifier for this state machine.
View Source
const (
TaskTypeSchedule = "scheduler.Schedule"
)
Variables ¶
View Source
var Module = fx.Module( "component.scheduler", fx.Provide(ConfigProvider), fx.Provide(TaskExecutorOptionsProvider), fx.Invoke(RegisterTaskSerializers), fx.Invoke(RegisterStateMachine), fx.Invoke(RegisterExecutor), )
View Source
var TransitionSchedulerActivate = hsm.NewTransition( []enumsspb.SchedulerState{enumsspb.SCHEDULER_STATE_WAITING}, enumsspb.SCHEDULER_STATE_WAITING, func(scheduler Scheduler, event EventSchedulerActivate) (hsm.TransitionOutput, error) { tasks, err := scheduler.RegenerateTasks(nil) return hsm.TransitionOutput{Tasks: tasks}, err })
View Source
var UseExperimentalHsmScheduler = dynamicconfig.NewNamespaceBoolSetting( "scheduler.use-experimental-hsm-scheduler", false, "When true, use the experimental scheduler implemented using the HSM framework instead of workflows")
Functions ¶
func MachineCollection ¶
func MachineCollection(tree *hsm.Node) hsm.Collection[Scheduler]
MachineCollection creates a new typed [statemachines.Collection] for callbacks.
func RegisterExecutor ¶
func RegisterExecutor( registry *hsm.Registry, executorOptions TaskExecutorOptions, config *Config, ) error
func RegisterStateMachine ¶
func RegisterTaskSerializers ¶
Types ¶
type Config ¶
type Config struct { }
func ConfigProvider ¶
func ConfigProvider(dc *dynamicconfig.Collection) *Config
type EventSchedulerActivate ¶
type EventSchedulerActivate struct{}
EventSchedulerActivate is triggered when the scheduler state machine should wake up and perform work.
type ScheduleTask ¶
func (ScheduleTask) Concurrent ¶
func (ScheduleTask) Concurrent() bool
func (ScheduleTask) Kind ¶
func (t ScheduleTask) Kind() hsm.TaskKind
func (ScheduleTask) Type ¶
func (ScheduleTask) Type() string
type ScheduleTaskSerializer ¶
type ScheduleTaskSerializer struct{}
func (ScheduleTaskSerializer) Deserialize ¶
type Scheduler ¶
type Scheduler struct {
*schedspb.HsmSchedulerState
}
Callback state machine.
func NewScheduler ¶
func NewScheduler(args *schedspb.StartScheduleArgs) Scheduler
NewCallback creates a new callback in the STANDBY state from given params.
func (Scheduler) RegenerateTasks ¶
func (Scheduler) SetState ¶
func (s Scheduler) SetState(state enumsspb.SchedulerState)
func (Scheduler) State ¶
func (s Scheduler) State() enumsspb.SchedulerState
type TaskExecutorOptions ¶
type TaskExecutorOptions struct { }
func TaskExecutorOptionsProvider ¶
func TaskExecutorOptionsProvider() TaskExecutorOptions
Click to show internal directories.
Click to hide internal directories.