Documentation ¶
Index ¶
Constants ¶
View Source
const (
//每个task存储到redis当中的key前缀,便于与其他数据的区分度
TASK_KEY_PREFIX = "delaytk_"
)
View Source
const (
//轮的时间长度,目前设置为一个小时,也就是时间轮每循环一次需要1小时;默认时间轮上面的每走一步的最小粒度为1秒。
WHEEL_SIZE = 3600
)
Variables ¶
This section is empty.
Functions ¶
func GetDelayQueue ¶
func GetDelayQueue(serviceBuilder BuildExecutor) *delayQueue
单列方法,使用默认的redis持久方案
func GetDelayQueueWithPersis ¶
func GetDelayQueueWithPersis(serviceBuilder BuildExecutor, persistence Persistence) *delayQueue
单列方法,使用外部传入的持久方案
func GetEvnWithDefaultVal ¶
Types ¶
type BuildExecutor ¶
定义一个获取实现具体任务对象的工厂方法,该方法需要在业务项目中定义并实现
type Persistence ¶
Click to show internal directories.
Click to hide internal directories.