delay

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallBack

type CallBack func(id string, queue string)

type Delay

type Delay struct {
	// contains filtered or unexported fields
}

func NewDelay

func NewDelay(rdsOption *redis.Options, vhost string) Delay

func (*Delay) On

func (t *Delay) On(queue string, cb CallBack)

注册回调

func (*Delay) Remove

func (t *Delay) Remove(queue string, id string)

func (*Delay) Scan

func (t *Delay) Scan() ([]string, error)

轮询到期任务

func (*Delay) Set

func (t *Delay) Set(queue string, id string, timestamp int) error

设置超时时间(时间戳),单位毫秒

func (*Delay) SetTimeout

func (t *Delay) SetTimeout(queue string, id string, duration time.Duration) error

Jump to

Keyboard shortcuts

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