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

Function addReplyPubsubPatUnsubscribed

src/pubsub.cpp:111–122  ·  view source on GitHub ↗

Send the pubsub pattern unsubscription notification to the client. * Pattern can be NULL: this is useful when the client sends a mass * punsubscribe command but there are no pattern to unsubscribe from: we * still send a notification. */

Source from the content-addressed store, hash-verified

109 * punsubscribe command but there are no pattern to unsubscribe from: we
110 * still send a notification. */
111void addReplyPubsubPatUnsubscribed(client *c, robj *pattern) {
112 if (c->resp == 2)
113 addReply(c,shared.mbulkhdr[3]);
114 else
115 addReplyPushLen(c,3);
116 addReply(c,shared.punsubscribebulk);
117 if (pattern)
118 addReplyBulk(c,pattern);
119 else
120 addReplyNull(c);
121 addReplyLongLong(c,clientSubscriptionsCount(c));
122}
123
124/*-----------------------------------------------------------------------------
125 * Pubsub low level API

Callers 2

pubsubUnsubscribePatternFunction · 0.85

Calls 6

addReplyFunction · 0.85
addReplyPushLenFunction · 0.85
addReplyBulkFunction · 0.85
addReplyNullFunction · 0.85
addReplyLongLongFunction · 0.85
clientSubscriptionsCountFunction · 0.85

Tested by

no test coverage detected