Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*timeWheel)
func WithLocation ¶
func WithLogger ¶
func WithTimeFunc ¶
type TimeWheeler ¶
type TimeWheeler interface {
Start()
//Stop:停止时间轮将会移除全部任务
Stop()
IsRunning() bool
AddTask(key string, f Task, execTime time.Time)
AddPeriodicTask(key string, f Task, Period time.Duration)
AddCronTask(key string, spec string, f Task) error
RemoveTask(key string)
}
func NewTimeWheel ¶
func NewTimeWheel(slotSize int, interval time.Duration, opts ...Option) TimeWheeler
Click to show internal directories.
Click to hide internal directories.
