Unsubscribe from all the patterns. Return the number of patterns the * client was subscribed from. */
| 275 | /* Unsubscribe from all the patterns. Return the number of patterns the |
| 276 | * client was subscribed from. */ |
| 277 | int pubsubUnsubscribeAllPatterns(client *c, int notify) { |
| 278 | serverAssert(GlobalLocksAcquired()); |
| 279 | listNode *ln; |
| 280 | listIter li; |
| 281 | int count = 0; |
| 282 | |
| 283 | listRewind(c->pubsub_patterns,&li); |
| 284 | while ((ln = listNext(&li)) != NULL) { |
| 285 | robj *pattern = (robj*)ln->value; |
| 286 | |
| 287 | count += pubsubUnsubscribePattern(c,pattern,notify); |
| 288 | } |
| 289 | if (notify && count == 0) addReplyPubsubPatUnsubscribed(c,NULL); |
| 290 | return count; |
| 291 | } |
| 292 | |
| 293 | /* Publish a message */ |
| 294 | int pubsubPublishMessage(robj *channel, robj *message) { |
no test coverage detected