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

Function pubsubUnsubscribeAllPatterns

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

Unsubscribe from all the patterns. Return the number of patterns the * client was subscribed from. */

Source from the content-addressed store, hash-verified

270/* Unsubscribe from all the patterns. Return the number of patterns the
271 * client was subscribed from. */
272int pubsubUnsubscribeAllPatterns(client *c, int notify) {
273 listNode *ln;
274 listIter li;
275 int count = 0;
276
277 listRewind(c->pubsub_patterns,&li);
278 while ((ln = listNext(&li)) != NULL) {
279 robj *pattern = ln->value;
280
281 count += pubsubUnsubscribePattern(c,pattern,notify);
282 }
283 if (notify && count == 0) addReplyPubsubPatUnsubscribed(c,NULL);
284 return count;
285}
286
287/* Publish a message */
288int pubsubPublishMessage(robj *channel, robj *message) {

Callers 4

punsubscribeCommandFunction · 0.85
freeClientFunction · 0.85
resetCommandFunction · 0.85
RM_CallFunction · 0.85

Calls 4

listRewindFunction · 0.85
listNextFunction · 0.85
pubsubUnsubscribePatternFunction · 0.85

Tested by

no test coverage detected