Commit 735ed0fe by 王昆

gsb

parent 17eca7ff
......@@ -4,6 +4,7 @@ const settings=require("../../config/settings");
const bluebird=require("bluebird");
bluebird.promisifyAll(redis);
// const logCtl=System.getObject("web.oplogCtl");
const CONTRACT_DOWNLOAD_CHANNEL = "bpo:contract:download";
class RedisClient{
constructor(){
const redisConfig=settings.redis();
......@@ -98,6 +99,22 @@ class RedisClient{
}
}
});
// 做一个简单队列
this.queueClient = this.client.duplicate();
this.queueClient.on("error", function (err) {
console.log("queueClient Error " + err);
});
var self=this;
this.queueClient.on("message",async function (channel, message) {
console.log(channel, message, '------------- queue message ------------------- ');
});
this.queueClient.subscribeAsync(CONTRACT_DOWNLOAD_CHANNEL);
}
async queuePublish(channel, msg){
channel = channel || CONTRACT_DOWNLOAD_CHANNEL;
console.log("queuePublish msg: ", channel, msg);
return this.queueClient.publishAsync(channel,msg);
}
async subscribe(channel,chatserver){
if(!this.chatserver){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment