Documentation
¶
Index ¶
- func GetDefaultCron() *cron.Cron
- func NewCron() *cron.Cron
- func NewDefaultCron()
- type Job
- type TaskData
- type TimeWheel
- func (tw *TimeWheel) AddTask(interval time.Duration, times int, key interface{}, data TaskData, job Job) error
- func (tw *TimeWheel) RemoveTask(key interface{}) error
- func (tw *TimeWheel) Start()
- func (tw *TimeWheel) Stop()
- func (tw *TimeWheel) UpdateTask(key interface{}, interval time.Duration, data TaskData) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultCron ¶
func GetDefaultCron() *cron.Cron
func NewDefaultCron ¶
func NewDefaultCron()
Types ¶
type TimeWheel ¶
type TimeWheel struct {
// contains filtered or unexported fields
}
func NewTimeWheel ¶
NewTimeWheel 时间间隔 轮盘大小
func (*TimeWheel) AddTask ¶
func (tw *TimeWheel) AddTask(interval time.Duration, times int, key interface{}, data TaskData, job Job) error
AddTask 添加任务 到时间轮 interval 时间间隔 次数 索引 参数 任务
func (*TimeWheel) RemoveTask ¶
Click to show internal directories.
Click to hide internal directories.