You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- package task
-
- import (
- distsvc "gitlink.org.cn/cloudream/common/pkgs/distlock/service"
- "gitlink.org.cn/cloudream/common/pkgs/task"
- )
-
- type TaskContext struct {
- distlock *distsvc.Service
- }
-
- // 需要在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(distlock *distsvc.Service) Manager {
- return task.NewManager(TaskContext{
- distlock: distlock,
- })
- }
|