asynq

package
v0.0.6-asynq Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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]) Add

func (t *Timer[T]) Add(opType timer.OpType, id T, delay time.Duration) error

func (*Timer[T]) Get

func (t *Timer[T]) Get(opType timer.OpType, id T) *timer.OperationItem[T]

func (*Timer[T]) GetAll

func (t *Timer[T]) GetAll() []*timer.OperationItem[T]

func (*Timer[T]) Register

func (t *Timer[T]) Register(opType timer.OpType, handler func(T))

func (*Timer[T]) Remove

func (t *Timer[T]) Remove(opType timer.OpType, id T) error

func (*Timer[T]) Start

func (t *Timer[T]) Start()

func (*Timer[T]) Stop

func (t *Timer[T]) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL