17 lines
387 B
JavaScript
17 lines
387 B
JavaScript
|
|
export function publishActionReply(redisCnx, options) {
|
|
const {
|
|
action,
|
|
reqid,
|
|
sender,
|
|
reply,
|
|
replyChannel,
|
|
senderId = 'observer',
|
|
} = options
|
|
reply.action = action
|
|
reply.sender = senderId
|
|
if(reqid) reply.reqid = reqid
|
|
const chan = replyChannel.replace(/\[UID\]/g, sender)
|
|
redisCnx.redisPublish(chan, reply)
|
|
}
|