Redis › Pub/Sub
What is pattern based subscription using PSUBSCRIBE, and how does it differ from subscribing to specific individual channels?
IntermediateAnswer
PSUBSCRIBE lets you subscribe to multiple channels at once that match a specified wildcard pattern, rather than needing to individually subscribe to each specific channel name, which is useful when you want to receive messages from a whole category of related channels without knowing their exact names in advance.
PSUBSCRIBE news.*
-- Receives messages published to news.sports,
-- news.weather, news.technology, and any other matching channelReal-world example A news aggregation application subscribes to all channels matching the news wildcard pattern, automatically receiving updates from any new category channel that gets created later without needing code changes.