pubsub-numpat.3valkey - Man Page

Returns a count of unique pattern subscriptions.

Synopsis

PUBSUB NUMPAT

Description

Returns the number of unique patterns that are subscribed to by clients (that are performed using the PSUBSCRIBE command).

Note that this isn’t the count of clients subscribed to patterns, but the total number of unique patterns all the clients are subscribed to.

Cluster note: in a Valkey Cluster clients can subscribe to every node, and can also publish to every other node. The cluster will make sure that published messages are forwarded as needed. That said, PUBSUB’s replies in a cluster only report information from the node’s Pub/Sub context, rather than the entire cluster.

Reply

valkey-protocol(7) Integer reply: the number of patterns all the clients are subscribed to.

Complexity

O(1)

Acl Categories

@pubsub @slow

History

See Also

psubscribe(3valkey), publish(3valkey), pubsub(3valkey), pubsub-channels(3valkey), pubsub-help(3valkey), pubsub-numsub(3valkey), pubsub-shardchannels(3valkey), pubsub-shardnumsub(3valkey), punsubscribe(3valkey), spublish(3valkey), ssubscribe(3valkey), subscribe(3valkey), sunsubscribe(3valkey), unsubscribe(3valkey)

Info

2024-09-23 8.0.0 Valkey Command Manual