atv-dee-delayqueue
v1.0.0
Published
消息队列延迟处理
Downloads
2
Readme
Dee DelayQueue Service
A delay queue service for dee framework
Usage
import * as DeeDelayQueue from "atv-dee-delayqueue";
Dee({
services: {
delayqueue: {
initialize: DeeDelayQueue.init,
deps: ["redis"],
args: <DeeDelayQueue.Args<any>>{
ns: "delayqueue", // namespace, 也是 redis key prefix
producers: {
task1: {
schema: {
k: { type: "string" }
},
pLimit: 10, // 任务最大并发量
},
},
pollInterval: 1, // in seconds
handlers: {
task1: async (ctx: DeeDelayQueue.Context) => {
}
}
}
},
}
});
srvs.delayqueue.publish('task', delay, data)