MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / addReplyPubsubMessage

Function addReplyPubsubMessage

src/pubsub.cpp:44–52  ·  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

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