forked from JointCloud/JCC-CSScheduler
29 lines
659 B
Go
29 lines
659 B
Go
package task
|
||
|
||
import (
|
||
"gitlink.org.cn/cloudream/common/pkgs/task"
|
||
reporter "gitlink.org.cn/cloudream/scheduler/advisor/internal/reporter"
|
||
)
|
||
|
||
type TaskContext struct {
|
||
reporter *reporter.Reporter
|
||
}
|
||
|
||
// 需要在Task结束后主动调用,completing函数将在Manager加锁期间被调用,
|
||
// 因此适合进行执行结果的设置
|
||
type CompleteFn = task.CompleteFn
|
||
|
||
type Manager = task.Manager[TaskContext]
|
||
|
||
type TaskBody = task.TaskBody[TaskContext]
|
||
|
||
type Task = task.Task[TaskContext]
|
||
|
||
type CompleteOption = task.CompleteOption
|
||
|
||
func NewManager(reporter *reporter.Reporter) Manager {
|
||
return task.NewManager(TaskContext{
|
||
reporter: reporter,
|
||
})
|
||
}
|