Versions in this module Expand all Collapse all v0 v0.1.1 Oct 15, 2026 v0.1.0 Oct 15, 2026 Changes in this version + type Handler func(ctx context.Context, task *Task) error + type LocalBackend struct + func NewLocalBackend(handler Handler, opts ...TimerTaskOption) *LocalBackend + func (b *LocalBackend) LocalPendingCount() int + func (b *LocalBackend) PendingCount(ctx context.Context) (int64, error) + func (b *LocalBackend) Send(ctx context.Context, task *Task) error + func (b *LocalBackend) Start(ctx context.Context) error + type RedisBackend struct + func NewRedisBackend(buzType string, client redis.UniversalClient, handler Handler, ...) *RedisBackend + func (b *RedisBackend) LocalPendingCount() int + func (b *RedisBackend) PendingCount(ctx context.Context) (int64, error) + func (b *RedisBackend) Send(ctx context.Context, task *Task) error + func (b *RedisBackend) Start(ctx context.Context) error + type ShardManager struct + func NewShardManager(buzType string, client redis.UniversalClient, totalShards int) *ShardManager + func (s *ShardManager) GetClientID() string + func (s *ShardManager) GetMyShards() []int + func (s *ShardManager) StartAssign(ctx context.Context) + func (s *ShardManager) StartHeartbeat(ctx context.Context) + type Task struct + Action string + CreateTime int64 + EndTime int64 + Extra string + ID string + MaxRetry int + Param string + RetryCount int + type TimerTask interface + LocalPendingCount func() int + PendingCount func(ctx context.Context) (int64, error) + Send func(ctx context.Context, task *Task) error + Start func(ctx context.Context) error + type TimerTaskOption func(*config) + func WithBuckets(n int) TimerTaskOption + func WithOnFailure(fn func(task *Task, err error)) TimerTaskOption + func WithRetry(count int, delay time.Duration) TimerTaskOption + func WithWorkers(n int) TimerTaskOption