MCPcopy Create free account
hub / github.com/F-Stack/f-stack / addReplyPubsubMessage

Function addReplyPubsubMessage

app/redis-6.2.6/src/pubsub.c:43–51  ·  view source on GitHub ↗

Send a pubsub message of type "message" to the client. * Normally 'msg' is a Redis object containing the string to send as * message. However if the caller sets 'msg' as NULL, it will be able * to send a special message (for instance an Array type) by using the * addReply*() API family. */

Source from the content-addressed store, hash-verified

41 * to send a special message (for instance an Array type) by using the
42 * addReply*() API family. */
43void addReplyPubsubMessage(client *c, robj *channel, robj *msg) {
44 if (c->resp == 2)
45 addReply(c,shared.mbulkhdr[3]);
46 else
47 addReplyPushLen(c,3);
48 addReply(c,shared.messagebulk);
49 addReplyBulk(c,channel);
50 if (msg) addReplyBulk(c,msg);
51}
52
53/* Send a pubsub message of type "pmessage" to the client. The difference
54 * with the "message" type delivered by addReplyPubsubMessage() is that

Callers 2

pubsubPublishMessageFunction · 0.85
sendTrackingMessageFunction · 0.85

Calls 3

addReplyFunction · 0.85
addReplyPushLenFunction · 0.85
addReplyBulkFunction · 0.85

Tested by

no test coverage detected