antirez/redis — Issue #123: P?SUBSCRIPTIONS command: list current subscriptions
Author: dominictarr
Created: 2011-10-08 07:59:42+00:00
State: open

I've am writing a redis client for nodejs, and the trickiest thing is dealing with P?UNSUBSCRIBE replys.

the difficulty is that P?UNSUBSCRIBE makes many replies, so it is necessary to calculate how many replys I should expect,
by keeping a count of the number of current subscriptions, so that when the user asks to UNSUBSCRIBE I can pass them the correct list of channels/patterns that they are subscribed to.

Idealy, I think it's simpler if P?UNSUBSCRIBE does a regular MultiBulk reply, but as that would be a breaking API change, A work around could be a P?SUBSCRIPTIONS command, that would have the same semantics as P?UNSUBSCRIBE but instead reply with a list of channels that would be unsubscribed if you passed the same arguments to P?UNSUBSCRIBE.