UNSUBSCRIBE(3valkey)

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

✨ NAME ✨

unsubscribe β€” bestie, this is how you stop listening to messages posted to channels. We're closing the door, we're leaving the group chat, we're at peace πŸ’…


🌸 SYNOPSIS 🌸

UNSUBSCRIBE channel [channel...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, UNSUBSCRIBE unsubscribes the client from the channels you name β€” or from all of them if you don't name any. The way that you can just... say nothing and it handles everything? Iconic behaviour, honestly.

When no channels are specified, the client gets unsubscribed from all the previously subscribed channels. And in that case, a message for every single unsubscribed channel gets sent to the client β€” so you're not left guessing, you get a lil receipt for each one 🧾✨


πŸ’Œ REPLY πŸ’Œ

When it works, this command doesn't return anything. Nope, nothing, silence, peace and quiet 🀫

Instead, for each channel, one message gets pushed to the client β€” with the first element being the string unsubscribe β€” as a confirmation that the command succeeded. That's your proof, that's your slay, that's your unsubscribe string showing up like "hey bestie, done" 🫢


πŸ”₯ COMPLEXITY πŸ”₯

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

(Translation: it scales with how many channels you're ditching. Unsubscribe from one, cheap. Unsubscribe from a hundred, it's giving a hundred units of effort. No cap.)


πŸ‘‘ ACL CATEGORIES πŸ‘‘

  • @pubsub
  • @slow

⭐ HISTORY ⭐

  • Available since: 2.0.0

Like... it's been here since 2.0.0. A literal elder. Respect the elders πŸ™‡β™€οΈ


🌈 SEE ALSO 🌈


okay that's the whole page, you ate that πŸŽ€ this was Valkey Command Manual, version 9.0.0, dated 2025-10-21 β€” go unsubscribe from something, you deserve the quiet πŸ¦‹πŸ’–

πŸ“¦ where this page comes from