Documentation ¶
Index ¶
Constants ¶
View Source
const ( RetSysError int = iota - 1 RetOk RetInvalidParam RetTypeInvalid RetStartTimeInvalid RetCallBackInvalid RetIdAndNameInvalid )
View Source
const (
MethodRpc = "RPC"
)
Variables ¶
View Source
var ( ErrSysError = errors.New("system error") ErrInvalidArgument = errors.New("invalid argument") ErrTaskTypeInvalid = errors.New("task type is invalid") ErrTaskStartTimeInvalid = errors.New("task starttime is invalid") ErrTaskCallBackInvalid = errors.New("task url or methon is invalid") ErrIdAndNameInvalid = errors.New("id and name is invalid") )
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { // Unique Id to identify, this is task id. Id int64 Name string RunningType RunType //normal, retry, doagain //Timer callback Func interface{} Arg interface{} //Current retry count RetryCnt int //Retry list second RetryList []uint32 Type NodeType // If type is Repeate, Schedule is valid, the schedule on which this job should be run. Schedule Schedule //expire tick, real run after ExpireTick ExpireTick uint32 }
func (*Node) IsNeedRetry ¶
func (*Node) IsNormalRun ¶
type Schedule ¶
type Schedule interface { // Return the next activation time, later than the given time. // Next is invoked initially, and then each time the job is run. Next(time.Time) time.Time }
// Job is an interface for submitted cron jobs.
type Job interface { Run() }
The Schedule describes a job's duty cycle.
Click to show internal directories.
Click to hide internal directories.