Files
orbit/weave/model/wait.go

33 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import (
"time"
core "git.yuntuo.hk/k2safe/orbit/model"
)
// Wait 表示可恢复的信号或时间等待,不长期占用业务 Worker。
// 对应表 weave_waits;这是服务端持久化模型,不直接作为 API 响应。
type Wait struct {
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
core.Record
// WorkflowID 所属流程实例标识。
WorkflowID core.ID `db:"workflow_id"`
// ActivationID 所属步骤激活,区分旧轮次和人工恢复后的新轮次。
ActivationID core.ID `db:"activation_id"`
// Kind 节点或等待类型,决定由哪类推进规则处理。
Kind string `db:"kind"`
// State 当前状态;只允许定义的状态转换并配合事务校验。
State WaitState `db:"state"`
// CorrelationKey 外部业务操作关联键,防止旧信号误用于新工作。
CorrelationKey string `db:"correlation_key"`
// DeadlineAt 等待截止时间,用可靠受理时间判断信号是否按时到达。
DeadlineAt time.Time `db:"deadline_at"`
// WakeTaskID 内部定时唤醒任务;无需定时唤醒时为空。
WakeTaskID *core.ID `db:"wake_task_id"`
// ResolvedAt 等待或查询节点结清的时间;尚未结清时为空。
ResolvedAt *time.Time `db:"resolved_at"`
}
func (Wait) TableName() string { return "weave_waits" }