PSUBSCRIBE
PSUBSCRIBE pattern
- Available since
- 2.0.0
- Time complexity
- O(N) where N is the number of patterns to subscribe to.
- ACL categories
- @pubsub, @slow
Subscribes the client to the given patterns.
Supported glob-style patterns:
h?llosubscribes tohello,halloandhxlloh*llosubscribes tohlloandheeeelloh[ae]llosubscribes tohelloandhallo,but nothillo
Use \ 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 SUBSCRIBE, SSUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, SUNSUBSCRIBE, PUNSUBSCRIBE, PING, RESET and QUIT commands.
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.
Behavior change history #
>= 6.2.0:RESETcan be called to exit subscribed state.