Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ItemOption ¶ added in v2.0.8
type ItemOption func(j *JobItem)
func WithItemDebug ¶ added in v2.0.8
func WithItemDebug(debug bool) ItemOption
func WithItemId ¶ added in v2.0.8
func WithItemId(id int64) ItemOption
func WithItemReplace ¶ added in v2.9.5
func WithItemReplace(replace bool) ItemOption
type Job ¶ added in v2.0.7
type Job struct {
// contains filtered or unexported fields
}
func (*Job) BeforeExec ¶ added in v2.0.7
func (j *Job) BeforeExec()
type JobItem ¶
type JobItem struct { JobId int64 //任务标识 AddTime int64 //添加时间 BeginTime int64 //开始时间 Worker JobWorker //任务对象 StartTime int64 //开始时间 Debug bool //是否调试 Id string //任务唯一标识 Replace bool //同jobid是否替换 }
func NewJobItem ¶
func NewJobItem(delay time.Duration, worker JobWorker, options ...ItemOption) *JobItem
type JobKeeper ¶
type JobKeeper struct { Name string List JobQueues Index map[int64]*JobQueue AddChan chan *JobItem DelChan chan int64 StopChan chan struct{} IdList map[int64]map[int64]int }
func NewJobKeeper ¶
type JobQueue ¶
type JobQueue struct { StartTime int64 //开始时间 JobItems *ds.Queue //任务队列 // contains filtered or unexported fields }
func NewJobQueue ¶
Click to show internal directories.
Click to hide internal directories.