Versions in this module Expand all Collapse all v0 v0.0.2 Apr 6, 2026 v0.0.1 Apr 6, 2026 Changes in this version + const STATE_READY + const STATE_SHUTTING_DOWN + const STATE_TERMINATED + type DelayWheel struct + func New(tick time.Duration, wheelSize int, options ...Option) (*DelayWheel, error) + func (de *DelayWheel) AfterExecute(d time.Duration, executor Executor) (taskId uint64, err error) + func (de *DelayWheel) AfterFunc(d time.Duration, f func(task *TaskCtx)) (taskId uint64, err error) + func (de *DelayWheel) CancelTask(taskID uint64) + func (de *DelayWheel) PendingChan() <-chan func() + func (de *DelayWheel) ScheduleExecute(d time.Duration, executor Executor) (taskId uint64, err error) + func (de *DelayWheel) ScheduleFunc(d time.Duration, f func(ctx *TaskCtx)) (taskId uint64, err error) + func (de *DelayWheel) Start() + func (de *DelayWheel) Stop(stopFunc StopFunc) error + type Executor interface + Execute func(taskCtx *TaskCtx) + type LogLevel int + const LOG_DEBUG + const LOG_ERROR + const LOG_INFO + const LOG_WARN + type Logger interface + Debug func(format string, args ...any) + Error func(format string, args ...any) + Info func(format string, args ...any) + Warn func(format string, args ...any) + type Option func(*DelayWheel) + func WithAutoRun() Option + func WithCurTaskID(num uint64) Option + func WithLogLevel(level LogLevel) Option + func WithLogger(logger Logger) Option + func WithPendingBufferSize(size int) Option + type StopCtx struct + func (ctx *StopCtx) GetAllTask() []*Task + func (ctx *StopCtx) WaitForDone(inputCtx context.Context) + type StopFunc func(stopCtx *StopCtx) error + type Task struct + func (dt *Task) Cancel() + func (dt *Task) Execute() + func (dt *Task) Executor() Executor + func (dt *Task) Expiration() int64 + func (dt *Task) IsCanceled() bool + func (dt *Task) TaskID() uint64 + type TaskCtx struct + func (ctx *TaskCtx) Cancel() + func (ctx *TaskCtx) Expiration() int64 + func (ctx *TaskCtx) ExpireTime() time.Time + func (ctx *TaskCtx) IsCancelled() bool + func (ctx *TaskCtx) ReSchedule(d time.Duration) + func (ctx *TaskCtx) TaskID() uint64