MCPcopy Create free account
hub / github.com/devfeel/dottask / NewLoopTask

Function NewLoopTask

looptask.go:88–100  ·  view source on GitHub ↗

NewLoopTask create new loop task

(taskID string, isRun bool, dueTime int64, interval int64, handler TaskHandle, taskData interface{})

Source from the content-addressed store, hash-verified

86
87// NewLoopTask create new loop task
88func NewLoopTask(taskID string, isRun bool, dueTime int64, interval int64, handler TaskHandle, taskData interface{}) (Task, error) {
89 task := new(LoopTask)
90 task.initCounters()
91 task.taskID = taskID
92 task.TaskType = TaskType_Loop
93 task.IsRun = isRun
94 task.handler = handler
95 task.DueTime = dueTime
96 task.Interval = interval
97 task.State = TaskState_Init
98 task.TaskData = taskData
99 return task, nil
100}
101
102//start loop task
103func startLoopTask(task *LoopTask) {

Callers 1

CreateLoopTaskMethod · 0.85

Calls 1

initCountersMethod · 0.80

Tested by

no test coverage detected