SUNSUBSCRIBE(3valkey)

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

πŸ’– SUNSUBSCRIBE πŸ’–

okay bestie, welcome to the Valkey Command Manual β€” this one lives in section 3valkey and it's literally the "bye shard channels" button πŸ’…


✨ NAME ✨

sunsubscribe β€” stops listening to messages posted to shard channels.

no cap. that's the whole vibe. you subscribed, now you're un-subscribing πŸ¦‹


🌸 SYNOPSIS 🌸

SUNSUBSCRIBE shardchannel [shardchannel...]

πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea, bestie: this unsubscribes the client from the shard channels you name, or from all of them if you name none at all. main character energy either way πŸ‘‘

When no shard channels are specified, the client is unsubscribed from all the previously subscribed shard channels. And in that case? A message for every unsubscribed shard channel gets sent to the client. like, one lil goodbye note each πŸ₯Ί

Note: the global channels and shard channels need to be unsubscribed from separately. they are not the same thing, they do not share a vibe, do not try to two-for-one this πŸ™ˆ

For more info about sharded Pub/Sub, go check out valkey-pubsub(7) Sharded Pub/Sub. iykyk πŸ“š


πŸ’Œ REPLY πŸ’Œ

When it works, this command doesn't return anything. nothing. silence. iconic.

Instead β€” for each shard channel β€” one message is pushed where the first element is the string sunsubscribe. that's your confirmation that the command succeeded. it's giving receipt 🧾✨


πŸ”₯ COMPLEXITY πŸ”₯

O(N) where N is the number of shard channels to unsubscribe.


πŸ‘‘ ACL CATEGORIES πŸ‘‘

  • @pubsub
  • @slow

🌈 HISTORY 🌈

  • Available since: 7.0.0 ⭐

🫢 SEE ALSO 🫢


okay that's the whole page, no crumbs left πŸ“ this was Valkey 9.0.0, dated 2025-10-21 β€” go unsubscribe from something, bestie, and hydrate while you're at it πŸ’–πŸ§š

πŸ“¦ where this page comes from