Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TaskName = "run_task_matrix" TaskDescriptor = &types.TaskDescriptor{ Name: TaskName, Description: "Run a task multiple times based on an input array.", Category: "flow-control", Config: DefaultConfig(), Outputs: []types.TaskOutputDefinition{}, NewTask: NewTask, } )
Functions ¶
func NewTask ¶
func NewTask(ctx *types.TaskContext, options *types.TaskOptions) (types.Task, error)
Types ¶
type Config ¶
type Config struct {
Task *helper.RawMessageMasked `yaml:"task" json:"task" require:"A" desc:"The task template to execute for each matrix value."`
MatrixVar string `yaml:"matrixVar" json:"matrixVar" desc:"Variable name to bind each matrix value to during task execution."`
MatrixValues []any `yaml:"matrixValues" json:"matrixValues" desc:"List of values to iterate over, executing the task for each."`
// Whether to run tasks concurrently (default: false - sequential)
RunConcurrent bool `yaml:"runConcurrent" json:"runConcurrent" desc:"If true, run all matrix tasks concurrently instead of sequentially."`
// Threshold behavior:
// - 0 (default): No threshold - only evaluate result when ALL tasks complete
// - >0: Set result when threshold is reached (but continue until all complete unless StopOnThreshold=true)
SuccessThreshold uint64 `` /* 136-byte string literal not displayed */
FailureThreshold uint64 `` /* 126-byte string literal not displayed */
// Early termination - if true, stop immediately when a threshold is reached
// Default: false - always wait for all tasks to complete
StopOnThreshold bool `` /* 140-byte string literal not displayed */
// Result transformation
InvertResult bool `yaml:"invertResult" json:"invertResult" desc:"If true, swap success and failure results."`
IgnoreResult bool `yaml:"ignoreResult" json:"ignoreResult" desc:"If true, always report success regardless of child task results."`
}
func DefaultConfig ¶
func DefaultConfig() Config
func (*Config) IsRunConcurrent ¶
IsRunConcurrent returns whether the matrix tasks should run concurrently.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func (*Task) LoadConfig ¶
Click to show internal directories.
Click to hide internal directories.