Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionInfo ¶
type ExecutionInfo struct {
TaskID uuid.UUID
Components []WorkflowComponent
// RuleDefinition is the resolved operation rule, determined at task
// creation time and carried through to the workflow unchanged.
RuleDefinition *operationrules.RuleDefinition
// OperationType identifies which workflow to dispatch to. The executor
// looks up the registered WorkflowDescriptor by this value and submits
// the workflow by its stable Temporal name.
OperationType taskcommon.TaskType
// OperationInfo is the serialized operation-specific payload. The
// executor passes it to the WorkflowDescriptor's Unmarshal function,
// which deserializes and validates it before the workflow starts.
OperationInfo json.RawMessage
}
ExecutionInfo contains the information needed to execute a task.
type ExecutionRequest ¶
type ExecutionRequest struct {
Info ExecutionInfo
Async bool
}
ExecutionRequest holds the parameters for submitting a task for execution.
func (*ExecutionRequest) Validate ¶
func (r *ExecutionRequest) Validate() error
Validate returns an error if the ExecutionRequest is missing required fields.
type ExecutionResponse ¶
type ExecutionResponse struct {
ExecutionID string
}
ExecutionResponse holds the result of a task execution submission.
func (*ExecutionResponse) IsValid ¶
func (r *ExecutionResponse) IsValid() bool
IsValid reports whether the ExecutionResponse contains a non-empty execution ID.
type Task ¶
type Task struct {
ID uuid.UUID
Operation operation.Wrapper
RackID uuid.UUID // The rack this task operates on (1 task = 1 rack)
Attributes taskcommon.TaskAttributes
Description string
ExecutorType taskcommon.ExecutorType
ExecutionID string
Status taskcommon.TaskStatus
Message string
AppliedRuleID *uuid.UUID // The ID of the operation rule that was applied
CreatedAt time.Time
UpdatedAt time.Time
StartedAt *time.Time
FinishedAt *time.Time
// QueueExpiresAt is the deadline for a waiting task to be promoted.
// After this time the Promoter terminates the task automatically.
// Nil for non-waiting tasks.
QueueExpiresAt *time.Time
}
Task defines the details of a task. It includes: -- ID: The unique identifier of the task. -- Operation: The operation to be performed by the task. -- RackID: The rack this task operates on (1 task = 1 rack). -- Attributes: Flexible metadata including targeted components by type. -- Description: The description of the task provided by the user. -- ExecutorType: The type of executor to be used for the task. -- ExecutionID: The identifier of the execution of the task. -- Status: The status of the task. -- Message: Status message or error details. -- AppliedRuleID: The ID of the operation rule that was applied (if any).
type TaskStatusUpdate ¶
type TaskStatusUpdate struct {
ID uuid.UUID
Status taskcommon.TaskStatus
Message string
}
TaskStatusUpdate carries the fields needed to update a task's status.
type TaskStatusUpdater ¶
type TaskStatusUpdater interface {
// UpdateTaskStatus persists the status change described by arg.
UpdateTaskStatus(ctx context.Context, arg *TaskStatusUpdate) error
}
TaskStatusUpdater is implemented by any store that can persist task status changes.
type WorkflowComponent ¶
type WorkflowComponent struct {
Type devicetypes.ComponentType `json:"type"`
ComponentID string `json:"component_id"`
}
WorkflowComponent holds the minimal component data needed to execute a workflow. All fields are plain JSON-safe types.