Documentation
¶
Index ¶
- Constants
- type Option
- type Timer
- func (t *Timer[T]) Add(opType timer.OpType, id T, delay time.Duration) error
- func (t *Timer[T]) Get(opType timer.OpType, id T) *timer.OperationItem[T]
- func (t *Timer[T]) GetAll() []*timer.OperationItem[T]
- func (t *Timer[T]) Register(opType timer.OpType, handler func(T))
- func (t *Timer[T]) Remove(opType timer.OpType, id T) error
- func (t *Timer[T]) Start()
- func (t *Timer[T]) Stop()
Constants ¶
View Source
const DefaultQueue = "default"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option[T comparable] func(*Timer[T])
func WithQueueName ¶
func WithQueueName[T comparable](queue string) Option[T]
func WithTimerInterval ¶
func WithTimerInterval[T comparable](interval time.Duration) Option[T]
type Timer ¶
type Timer[T comparable] struct { sync.RWMutex // contains filtered or unexported fields }
func NewTimer ¶
func NewTimer[T comparable](redisOpt *asynq.RedisClientOpt, opts ...Option[T]) *Timer[T]
func (*Timer[T]) GetAll ¶
func (t *Timer[T]) GetAll() []*timer.OperationItem[T]
Click to show internal directories.
Click to hide internal directories.