pub
UK[p?b] 美[p?b]
n.Pub, hotel; inn
plural: pubs
sub
英[s?b] 美[s?b]
n. Submarine; substitute, substitute, substitute; subway; reviewer Member
vi.Be a stand-in, be a substitute player; be a stand-in, proofread (manuscript)
Third person singular: subs Plural: subs Present participle: subbing Past tense: subbed Past participle: subbed
redis PUBSUB command syntax
Function:PUBSUB is an introspection command for viewing the status of subscription and publishing systems. It consists of several subcommands in different formats.
Syntax: PUBSUB <subcommand> [argument [argument ...]]
Available versions: >= 2.8.0
Time complexity: O(N), N is the number of active channels (for shorter channels and patterns, the complexity of pattern matching is treated as a constant).
Returns: A list of active channels.
redis PUBSUB command example
# client-1 訂閱 news.it 和 news.sport 兩個頻道 client-1> SUBSCRIBE news.it news.sport Reading messages... (press Ctrl-C to quit) 1) "subscribe" 2) "news.it" 3) (integer) 1 1) "subscribe" 2) "news.sport" 3) (integer) 2 # client-2 訂閱 news.it 和 news.internet 兩個頻道 client-2> SUBSCRIBE news.it news.internet Reading messages... (press Ctrl-C to quit) 1) "subscribe" 2) "news.it" 3) (integer) 1 1) "subscribe" 2) "news.internet" 3) (integer) 2 # 首先, client-3 打印所有活躍頻道 # 注意,即使一個頻道有多個訂閱者,它也只輸出一次,比如 news.it client-3> PUBSUB CHANNELS 1) "news.sport" 2) "news.internet" 3) "news.it" # 接下來, client-3 打印那些與模式 news.i* 相匹配的活躍頻道 # 因為 news.sport 不匹配 news.i* ,所以它沒有被打印 redis> PUBSUB CHANNELS news.i* 1) "news.internet" 2) "news.it"