Client B issues publish chan-foo hello
Redis forwards the published message to client A
Client A receives *3<CRLF>$7<CRLF>message<CRLF>$8<CRLF>chan-foo<CRLF>
$5<CRLF>hello<CRLF>
The problem is that the pattern (chan-*) is missing.
This means Client A must replicate the logic of matching the channel
to the original pattern in order to call the correct callback
function. If the client defers it such that there is but a single
"onMessage" callback, well, that's not interesting.
Perhaps consider that the "message" multi-bulk reply should contain
both the channel published on and the pattern the client psubscribed
to?
*4<CRLF>$7<CRLF>message<CRLF>$8<CRLF>chan-foo<CRLF>$6<CRLF>chan-*<CRLF>
$5<CRLF>hello<CRLF>
The client could spot this by *4 (cf. *3) when the first bulk reply
inside the multi bulk reply is "message".
Thoughts?