Documentation
¶
Index ¶
- Variables
- func NewRunID() string
- func PrepareRun(plan *planning.ExecutionPlan, run *wfruntime.WorkflowRun) *wfruntime.WorkflowRun
- type DefaultDispatcher
- type DefaultScheduler
- type Dispatcher
- type Engine
- type EventSink
- type ExecutorResolver
- type Heartbeat
- type HeartbeatReporter
- type MemoryRunController
- type NodeDispatcher
- type NopHeartbeatReporter
- type NopResultReporter
- type ResultReporter
- type RunCommand
- type RunController
- type Scheduler
- type StoreResultReporter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRunPaused = errors.New("run paused") ErrRunCancelled = errors.New("run cancelled") )
Functions ¶
func PrepareRun ¶
func PrepareRun(plan *planning.ExecutionPlan, run *wfruntime.WorkflowRun) *wfruntime.WorkflowRun
PrepareRun materializes the stable runtime identity and pending node records before execution starts. Async callers can persist this state and return the run ID without racing the scheduler goroutine.
Types ¶
type DefaultDispatcher ¶
type DefaultDispatcher struct{}
func NewDefaultDispatcher ¶
func NewDefaultDispatcher() *DefaultDispatcher
func (*DefaultDispatcher) Dispatch ¶
func (d *DefaultDispatcher) Dispatch(plan *planning.ExecutionPlan, run *wfruntime.WorkflowRun) []string
type DefaultScheduler ¶
type DefaultScheduler struct {
ExecutorDispatcher executor.Dispatcher
NodeDispatcher NodeDispatcher
Store wfruntime.Store
Sink EventSink
ResultReporter ResultReporter
HeartbeatReporter HeartbeatReporter
RunController RunController
}
func NewDefaultScheduler ¶
func NewDefaultScheduler(executors *executor.Registry, store wfruntime.Store) *DefaultScheduler
func (*DefaultScheduler) Run ¶
func (s *DefaultScheduler) Run(ctx context.Context, plan *planning.ExecutionPlan, run *wfruntime.WorkflowRun) (*wfruntime.WorkflowRun, error)
type Engine ¶
Engine is the new runtime facade: definition -> plan -> run.
func (*Engine) RunVersion ¶
func (e *Engine) RunVersion(ctx context.Context, version *definition.WorkflowVersion, run *wfruntime.WorkflowRun) (*wfruntime.WorkflowRun, error)
type ExecutorResolver ¶
ExecutorResolver keeps compatibility with existing call sites.
type Heartbeat ¶
type Heartbeat struct {
RunID string `json:"run_id"`
NodeID string `json:"node_id"`
ExecutorType string `json:"executor_type,omitempty"`
ExternalTaskID string `json:"external_task_id,omitempty"`
Status executor.Status `json:"status,omitempty"`
Message string `json:"message,omitempty"`
At time.Time `json:"at"`
Metadata map[string]any `json:"metadata,omitempty"`
}
type HeartbeatReporter ¶
HeartbeatReporter is useful for async/remote execution visibility.
type MemoryRunController ¶
type MemoryRunController struct {
// contains filtered or unexported fields
}
func NewMemoryRunController ¶
func NewMemoryRunController() *MemoryRunController
func (*MemoryRunController) Clear ¶
func (c *MemoryRunController) Clear(runID string)
func (*MemoryRunController) Get ¶
func (c *MemoryRunController) Get(runID string) RunCommand
func (*MemoryRunController) Set ¶
func (c *MemoryRunController) Set(runID string, cmd RunCommand)
type NodeDispatcher ¶
type NodeDispatcher interface {
Dispatch(plan *planning.ExecutionPlan, run *wfruntime.WorkflowRun) []string
}
NodeDispatcher decides which nodes are ready based on execution state.
type NopHeartbeatReporter ¶
type NopHeartbeatReporter struct{}
func (*NopHeartbeatReporter) ReportHeartbeat ¶
func (r *NopHeartbeatReporter) ReportHeartbeat(context.Context, Heartbeat) error
type NopResultReporter ¶
type NopResultReporter struct{}
func (*NopResultReporter) ReportResult ¶
func (r *NopResultReporter) ReportResult(context.Context, executor.ExecuteTask, executor.ExecuteResult) error
type ResultReporter ¶
type ResultReporter interface {
ReportResult(ctx context.Context, task executor.ExecuteTask, result executor.ExecuteResult) error
}
ResultReporter persists/forwards normalized task results.
type RunCommand ¶
type RunCommand string
const ( RunCommandNone RunCommand = "" RunCommandPause RunCommand = "pause" RunCommandCancel RunCommand = "cancel" )
type RunController ¶
type RunController interface {
Get(runID string) RunCommand
Set(runID string, cmd RunCommand)
Clear(runID string)
}
type Scheduler ¶
type Scheduler interface {
Run(ctx context.Context, plan *planning.ExecutionPlan, run *wfruntime.WorkflowRun) (*wfruntime.WorkflowRun, error)
}
type StoreResultReporter ¶
StoreResultReporter forwards normalized results into runtime events.
func (*StoreResultReporter) ReportResult ¶
func (r *StoreResultReporter) ReportResult(ctx context.Context, task executor.ExecuteTask, result executor.ExecuteResult) error
Click to show internal directories.
Click to hide internal directories.