PSUBSCRIBE
Subscribes the connection to channels matching a pattern.
Pub/Sub · Example verified
Syntax covered here
PSUBSCRIBE patternA wildcard pattern matched a published channel; delivery identified both the pattern and the actual channel.
Tested example & replies
Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.
# connection: subscriber
> PSUBSCRIBE news.*
["psubscribe","news.*",1]
# connection: default
> PUBLISH news.one hello
1
# connection: subscriber
# receive pushed message
["pmessage","news.*","news.one","hello"]
# connection: subscriber
> PUNSUBSCRIBE news.*
["punsubscribe","news.*",0]