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

Function psubscribeCommand

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

PSUBSCRIBE pattern [pattern ...] */

Source from the content-addressed store, hash-verified

370
371/* PSUBSCRIBE pattern [pattern ...] */
372void psubscribeCommand(client *c) {
373 int j;
374 if ((c->flags & CLIENT_DENY_BLOCKING) && !(c->flags & CLIENT_MULTI)) {
375 /**
376 * A client that has CLIENT_DENY_BLOCKING flag on
377 * expect a reply per command and so can not execute subscribe.
378 *
379 * Notice that we have a special treatment for multi because of
380 * backword compatibility
381 */
382 addReplyError(c, "PSUBSCRIBE isn't allowed for a DENY BLOCKING client");
383 return;
384 }
385
386 for (j = 1; j < c->argc; j++)
387 pubsubSubscribePattern(c,c->argv[j]);
388 c->flags |= CLIENT_PUBSUB;
389}
390
391/* PUNSUBSCRIBE [pattern [pattern ...]] */
392void punsubscribeCommand(client *c) {

Callers

nothing calls this directly

Calls 2

addReplyErrorFunction · 0.85
pubsubSubscribePatternFunction · 0.85

Tested by

no test coverage detected