PSUBSCRIBE pattern [pattern ...]
- Available since:
- Time complexity:
- O(N) where N is the number of patterns to subscribe to.
- ACL categories:
Subscribes the client to the given patterns.
Supported glob-style patterns:
\ to escape special characters if you want to match them verbatim.
Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional
However, if RESP3 is used (see
HELLO) it is possible for a client to issue any commands while in subscribed state.
For more information, see Pub/sub.
When successful, this command doesn't return anything. Instead, for each pattern, one message with the first element being the string "psubscribe" is pushed as a confirmation that the command succeeded.
Behavior change history
RESETcan be called to exit subscribed state.