Documentation
¶
Overview ¶
Package task_manager
Index ¶
Constants ¶
View Source
const ( ErrTaskStart = "task start failed" ErrTaskAlreadyAttach = "task already attached" ErrTaskTimeout = "task run timeout" )
View Source
const ( Created status = iota Started Stopped Running Done Exited // goroutine被回收强制停止 Unknown )
View Source
const EmptyName = ""
View Source
const (
TaskManagerPrefix = "[Task Manager]"
)
Variables ¶
View Source
var TaskGroup []interface{}
View Source
var TaskManager *taskManager
View Source
var TickerMap = map[string]*OneTicker{}
Functions ¶
func AddCronTask ¶ added in v1.1.1
func AddCronTask(id, name, spec string)
func GetSetOfTasks ¶ added in v1.1.1
func GetSetOfTasks()
GetSetOfTasks 任务去重处理,理论上不存在重复的uuid 仅针对Task
func InitTaskManager ¶ added in v1.1.1
func InitTaskManager()
Types ¶
type OneTicker ¶ added in v1.1.1
type OneTickerRes ¶ added in v1.1.1
type OneTickerRes struct {
UUID string `json:"uuid"`
Name string `json:"name"`
Des string `json:"des"`
Stopped bool `json:"stopped"`
CreateTime int64 `json:"create_time"`
Duration int `json:"duration"`
LastRun int64 `json:"lastRun"`
}
func GetAllBackgroundTasks ¶
func GetAllBackgroundTasks() []OneTickerRes
Click to show internal directories.
Click to hide internal directories.