feat: add bounded task priority and fair application dispatch
This commit is contained in:
@@ -43,8 +43,10 @@ type Task struct {
|
||||
OwnerKind *string `db:"owner_kind"`
|
||||
// OwnerID 来源资源标识,必须与来源类型同时有值或同时为空。
|
||||
OwnerID *core.ID `db:"owner_id"`
|
||||
// Priority 同一调度范围内的优先级,不承诺跨队列全局顺序。
|
||||
// Priority 冻结优先级,0至9,每级30秒排序优势;不提前最早执行时间。
|
||||
Priority int16 `db:"priority"`
|
||||
// DispatchAt 数据库生成的排序时间,AvailableAt 减 Priority 乘30秒;只读,不是执行授权。
|
||||
DispatchAt time.Time `db:"dispatch_at"`
|
||||
// AvailableAt 最早可被领取或处理的时间,统一 UTC。
|
||||
AvailableAt time.Time `db:"available_at"`
|
||||
// StartDeadlineAt 最晚允许新尝试开始的时间;为空时仅受总时限约束。
|
||||
|
||||
Reference in New Issue
Block a user