PUBSUB-S...CHANNELS(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– PUBSUB-SHARDCHANNELS πŸ’–

okay bestie, welcome to the Valkey Command Manual β€” this one's pubsub-shardchannels, page (3valkey), and it's genuinely so simple you're gonna eat πŸ’…


✨ NAME ✨

pubsub-shardchannels β€” Returns the active shard channels.

🌸 SYNOPSIS 🌸

PUBSUB SHARDCHANNELS [pattern]

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically it lists the currently active shard channels. That's it, that's the whole vibe. 🫢

An active shard channel is a Pub/Sub shard channel with one or more subscribers. No subscribers? Not active. Not on the list. It's giving "if you don't show up, you don't get mentioned." 😭

If no pattern is specified, all the channels are listed. But if pattern is specified, only channels matching that specified glob-style pattern get listed. Iconic filtering behaviour, no cap. ✨

lowkey important: the info returned about the active shard channels is at the shard level and not at the cluster level. Remember that. It matters. πŸ‘‘

πŸ’Œ REPLY πŸ’Œ

valkey-protocol(7) Array reply: a list of active channels, optionally matching the specified pattern.

πŸ”₯ COMPLEXITY πŸ”₯

O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short shard channels). Fast. Snappy. Main character energy. ⭐

πŸŽ€ ACL CATEGORIES πŸŽ€

  • @pubsub
  • @slow

πŸ‘‘ HISTORY πŸ‘‘

  • Available since: 7.0.0

🌈 EXAMPLES 🌈

> PUBSUB SHARDCHANNELS
1) "orders"
> PUBSUB SHARDCHANNELS o*
1) "orders"

look at that. clean. orders showed up both times because it's literally that girl. πŸ’…

πŸ’œ SEE ALSO πŸ’œ


okay that's the whole page, you understood all of it, slay πŸŽ€

Valkey version 9.0.0, dated 2025-10-21 β€” mwah, bye bestie, go check your shard channels πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from