【文件属性】:
文件名称:kueue:一个基于 NSQ 的简单生产者和消费者包装器
文件大小:5KB
文件格式:ZIP
更新时间:2021-07-09 08:15:41
Go
奎厄
基于 NSQ 的简单生产者和消费者包装器。
特征
发布任何类型的消息
支持延迟作业
在生产者池中
工人保姆可以照顾多个消费者
用法
生产者
import (
"time"
"github.com/heroicyang/kueue"
)
kueue . SetupProducers ( nsqdAddr , poolSize )
// publish any type of message
kueue . Publish ( "topic" , 0 , topicStruct )
// publish a delayed message
kueue . Publish ( "delayedTopic" , 1 * time . Hour , topicStruct )
消费者
import (
"encoding/json"
"github.com/
【文件预览】:
kueue-master
----handler.go(1KB)
----job.go(429B)
----producer.go(1KB)
----consumer.go(1KB)
----LICENSE(1KB)
----README.md(1KB)
----worker.go(1KB)
----.gitignore(266B)