Documentation ¶
Overview ¶
Package Task inft && schedule
Index ¶
- Constants
- Variables
- func CycleReloadCfg()
- func InitSvr(taskServerHost, lockServerHost string)
- func LoadCfg() error
- func RandNum(num int64) int64
- func RegisterHandler(handler *TaskHandler)
- type ScheduleData
- type ScheduleLog
- type TaskBase
- func (p *TaskBase) Base() *TaskBase
- func (p *TaskBase) ContextLoad() error
- func (p *TaskBase) CreateTask() (string, error)
- func (p *TaskBase) HandleFailedMust() error
- func (p *TaskBase) HandleFinishError() error
- func (p *TaskBase) HandleFinishMust() error
- func (p *TaskBase) SetContextLocal(data interface{})
- func (p *TaskBase) SetTask() error
- type TaskHandler
- type TaskIntf
- type TaskMgr
Constants ¶
View Source
const (
DEFAULT_TIME_INTERVAL = 20 // for second
)
View Source
const (
MAX_ERR_MSG_LEN = 256
)
Variables ¶
View Source
var MaxConcurrentRunTimes = 20
Functions ¶
func RegisterHandler ¶
func RegisterHandler(handler *TaskHandler)
RegisterHandler func RegisterHandler
Types ¶
type ScheduleData ¶
ScheduleData struct ScheduleData
type ScheduleLog ¶
type ScheduleLog struct { LastData ScheduleData HistoryDatas []ScheduleData }
ScheduleLog struct ScheduleLog
type TaskBase ¶
type TaskBase struct { Id uint64 TaskId string UserId string Status int TaskType string TaskStage string TaskContext string CrtRetryNum int MaxRetryNum int MaxRetryInterval int ScheduleLog *ScheduleLog ContextIntf interface{} Priority int64 OrderTime int64 CreateTime time.Time ModifyTime time.Time }
TaskBase struct TaskBase
func (*TaskBase) CreateTask ¶
CreateTask func create task
func (*TaskBase) HandleFailedMust ¶
HandleFailedMust if err, then change status from failed to processing
func (*TaskBase) HandleFinishError ¶
HandleFinishError handle finish error
func (*TaskBase) HandleFinishMust ¶
HandleFinishMust handle finish HandleFinishMust
func (*TaskBase) SetContextLocal ¶
func (p *TaskBase) SetContextLocal(data interface{})
SetContextLocal func set context local
type TaskHandler ¶
TaskHandler struct TaskHandler
Click to show internal directories.
Click to hide internal directories.